/* ========================================
   UNIFIED CASE CARDS STYLES
   Unifies grid view with carousel design
   Preserves list view 100% unchanged
   ======================================== */

/* ===========================================
   BASE CARD STYLES (SHARED)
   =========================================== */

/* Card link styling */
.case-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    width: 100%;
    height: 100%;
}

/* ===========================================
   GRID VIEW STYLES (MODERN CAROUSEL DESIGN)
   =========================================== */

/* Base card for grid view */
.case-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #ededed;
    font-family: "Titillium Web", Sans-serif;
    min-height: 435px;
}

.case-card:hover {}

/* Card image */
.case-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.case-card-link:hover .case-image img {
    transform: scale(1.05);
}

/* Card placeholder */
.case-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.case-placeholder::before {
    content: "📷";
    font-size: 32px;
}

/* Status badge */
.case-status {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 124, 186, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

.case-status.venduta {
    background: rgba(220, 53, 69, 0.9);
}

.case-status.disponibile {
    background: rgba(40, 167, 69, 0.9);
}

.case-status.in-trattativa {
    background: rgba(255, 193, 7, 0.9);
    color: #333;
}

/* Price reduced badge */
.price-reduced {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    height: 25px;
    display: flex;
    align-items: center;
}

/* Card content */
.case-content {
    padding: 0px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Card title */
.case-title {
    padding: 15px;
    padding-bottom: 0;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #2c3e50;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card address wrapper */
.case-address-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 12px 0;
    gap: 10px;
    padding: 0 15px;
}

/* Card address */
.case-address {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
    overflow: hidden;
    font-weight: 600;
}

.case-address-wrapper .case-id {
    font-size: 15px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 700;
}

.swiper-slide .case-address {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
    font-weight: 600;
    flex: none;
}

/* Rating section */
.case-rating {
    margin: 30px 0 12px 0;
    text-align: center;
}

.case-rating .stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 20px;
}

.case-rating .star {
    transition: all 0.2s ease;
    font-size: inherit;
    line-height: 1;
}

.case-rating .star.full {
    color: #ffc107;
    text-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
}

.case-rating .star.half {
    position: relative;
    color: #e0e0e0;
}

.case-rating .star.half::before {
    content: "★";
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #ffc107;
    text-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
}

.case-rating .star.empty {
    color: #e0e0e0;
}

/* Features grid */
.case-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 12px 0;
    border-top: 1px solid #eee;
    background-color: #13223D;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.case-features .feature {
    text-align: center;
}

.case-features .feature-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.case-features .feature-label {
    display: block;
    font-size: 11px;
    color: #fba311;
    text-transform: uppercase;
    font-weight: 600;
}

/* Price section */
.case-price {
    margin-bottom: 15px;
    text-align: center;
}

.case-price .price {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* Actions */
.case-actions {
    margin-top: auto;
}

.case-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    background: #13223D;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
}

.case-card-link:hover .case-button {
    background: #FCA310;
    color: #13223D;
}

/* Case ID for grid view */
.case-id {
    margin-left: auto;
    color: #999;
    font-size: 12px;
}

/* ===========================================
   LIST VIEW STYLES (PRESERVED 100% FROM ARCHIVE-CASE.CSS)
   =========================================== */

/* Lista View - Card Layout */
.list-view .case-card {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    height: auto;
    min-height: 280px;
    transform: none !important;
    /* Override hover transform for list view */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background: #fff;
}

.list-view .case-card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-color: #13223D;
}

/* Lista View - Immagine */
.list-view .case-image {
    width: 300px;
    height: 280px;
    flex-shrink: 0;
    position: relative;
    border-radius: 8px 0 0 0px;
    overflow: hidden;
}

/* Lista View - Contenuto */
.list-view .case-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
    min-height: 280px;
    background: #fff;
}

.list-view .case-header {
    display: flex;
}

.list-view .case-id {
    margin-left: auto;
    color: #13213d;
    font-size: 15px;
    font-weight: 600;
}

/* Lista View - Titolo e Address */
.list-view .case-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2c3e50;
    display: block;
    /* Override line clamp */
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    line-height: 1.3;
    padding-left: 0;
}

.list-view .case-address-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 15px;
    padding-left: 0;
}

.list-view .case-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 0px;
    display: flex;
    align-items: center;
    flex: 1;
}

.list-view .case-address-wrapper .case-id {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    line-height: 1.4;
}

/* Lista View - Descrizione */
.list-view .case-description {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
    flex: 1;
    text-align: left;
    margin: 20px 0;
}

/* Lista View - Layout principale */
.list-view .case-main-info {
    display: flex;
    flex: 1;
    gap: 20px;
    margin-bottom: 16px;
}

.list-view .case-left-content {
    flex: 2;
}

.list-view .case-right-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Lista View - Caratteristiche */
.list-view .case-characteristics-list {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    display: flex;
    flex-wrap: wrap;
    column-gap: 40px;
}


.list-view .case-characteristics-list h4 {
    width: 100%;
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    grid-column: 1 / -1;
}

.list-view .char-item-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    justify-content: left;
    gap: 10px;
    color: #13213d;
    min-width: 200px;
}

.list-view .char-item-list .char-icon {
    color: #13213d;
}

.list-view .char-item-list .char-label {
    color: #666;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 0px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.list-view .char-item-list .char-value {
    color: #2c3e50;
    font-size: 14px;
    line-height: 14px;
    font-weight: 600;
    transform: translateY(-1px);
}

/* Lista View - Stato Immobile */
.list-view .case-status-section {
    background: transparent;
    border-radius: 6px;
    padding: 16px;
    border: none;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.list-view .case-status-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-view .case-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.list-view .case-status-item.overall-rating {
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 16px;
}

.list-view .case-status-item.overall-rating .case-status-label {
    font-weight: 600;
}

.list-view .case-status-label {
    color: #555;
    font-weight: 500;
}

.list-view .case-status-stars {
    color: #ffc107;
}

.list-view .case-status-item:last-child {
    margin-bottom: 0;
}

/* Lista View - Footer Info */
.list-view .case-footer-info {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    transition: all 0.2s ease;
}

.list-view .case-card:hover .case-footer-info {
    background: #f0f4f8;
}

.list-view .case-footer-left {
    display: flex;
    gap: 40px;
    align-items: center;
}

.list-view .case-footer-item {
    text-align: center;
}

.list-view .case-footer-item .footer-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 500;
    text-align: left;
}

.list-view .case-footer-item .footer-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.list-view .case-footer-price {
    font-size: 24px !important;
    color: #13223D;
    font-weight: 700;
}

.list-view .case-footer-button {
    background: #13223D;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
}

.list-view .case-footer-button:hover {
    background: #FCA310;
    color: #13223D;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(252, 163, 16, 0.3);
}

/* Vista Griglia - Nascondere elementi della lista */
.case-main-info,
.case-footer-info {
    display: none;
}

/* Lista View - Mostrare elementi della lista */
.list-view .case-main-info,
.list-view .case-footer-info {
    display: flex;
}

/* Lista View - Nascondere elementi della griglia */
.list-view .case-features {
    display: none;
}

.list-view .case-rating {
    display: none;
}

.list-view .case-price-section {
    display: none;
}

/* Vista Griglia - Nascondere ID duplicato */
.case-content>.case-id {
    display: none;
}

.list-view .case-content>.case-id {
    display: block;
}

/* ===========================================
   SHORTCODE CAROUSEL SPECIFIC STYLES
   =========================================== */

/* Container shortcode */
.case-shortcode-container {
    width: 100%;
    margin: 20px 0;
}

/* Swiper carousel customizations */
.case-swiper {
    width: 100%;
    padding: 0 50px;
}

.case-swiper .swiper-wrapper {
    align-items: stretch;
}

.case-swiper .swiper-slide {
    height: auto;
    display: flex;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) */
    overflow: visible;
}

/* Shortcode specific card styling */
.case-shortcode-container .case-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: none;
}

.case-shortcode-container .case-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Navigation buttons */
.case-swiper .swiper-button-next,
.case-swiper .swiper-button-prev {
    color: #13223D;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: -20px;
}

.case-swiper .swiper-button-next:after,
.case-swiper .swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
}

.case-swiper .swiper-button-next:hover,
.case-swiper .swiper-button-prev:hover {
    background: #FCA310;
    color: #13223D;
    transform: scale(1.1);
}

/* Pagination */
.case-swiper .swiper-pagination {
    position: relative;
    margin-top: 20px;
}

.case-swiper .swiper-pagination-bullet {
    background: #13223D;
    opacity: 0.3;
    width: 12px;
    height: 12px;
}

.case-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* Loading state */
.shortcode-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

/* No related cases */
.no-related-cases {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

@media (max-width: 768px) {

    /* Grid view responsive */
    .case-image {
        height: 180px;
    }

    .case-content {
        padding: 14px;
    }

    .case-title {
        font-size: 15px;
    }

    .case-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .case-features .feature-value {
        font-size: 14px;
    }

    .case-rating .stars {
        font-size: 14px;
    }

    /* Lista View - Responsive */
    .list-view .case-card {
        flex-direction: column;
        min-height: auto;
        border-radius: 8px;
        margin-bottom: 16px;
    }

    .list-view .case-image {
        width: 100%;
        height: 200px;
        border-radius: 8px 8px 0 0;
    }

    .list-view .case-content {
        padding: 16px;
        min-height: auto;
    }



    .list-view .case-main-info {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 16px;
    }

    .list-view .case-characteristics-list,
    .list-view .case-status-section {
        margin-bottom: 12px;
        padding: 12px;
    }

    .list-view .case-characteristics-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .list-view .case-footer-info {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 16px;
        border-radius: 0 0 8px 8px;
    }

    .list-view .case-footer-left {
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }

    .list-view .case-footer-button {
        width: 100%;
        max-width: 280px;
        margin-top: 8px;
    }

    /* Shortcode responsive */
    .case-shortcode-container .case-image {
        height: 180px;
    }

    .case-shortcode-container .case-content {
        padding: 14px;
    }

    .case-shortcode-container .case-title {
        font-size: 15px;
    }

    .case-shortcode-container .case-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .case-shortcode-container .case-features .feature-value {
        font-size: 14px;
    }

    .case-shortcode-container .case-rating .stars {
        font-size: 14px;
    }

    /* Lista View - Mobile improvements */
    .list-view .case-title {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .list-view .case-address {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .list-view .case-description {
        font-size: 13px;
        line-height: 1.5;
    }

    .list-view .case-characteristics-list h4,
    .list-view .case-status-section h4 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .list-view .char-item-list {
        padding: 8px;
    }

    .list-view .char-item-list .char-icon {
        font-size: 16px !important;
    }

    .list-view .char-item-list .char-label {
        font-size: 10px;
    }

    .list-view .char-item-list .char-value {
        font-size: 12px;
    }

    .list-view .case-status-item {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .list-view .case-footer-item .footer-value {
        font-size: 16px;
    }

    .list-view .case-footer-price {
        font-size: 20px !important;
    }
}

@media (max-width: 480px) {

    /* Grid view mobile */
    .case-image {
        height: 160px;
    }

    .case-content {
        padding: 0px;
    }

    .case-title {
        font-size: 14px;
    }

    .case-features {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
    }

    .case-button {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Lista View - Mobile caratteristiche */
    .list-view .case-characteristics-list {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
    }

    .list-view .char-item-list {
        padding: 6px;
    }

    .list-view .char-item-list .char-icon {
        font-size: 14px !important;
        margin-bottom: 3px;
    }

    .list-view .char-item-list .char-label {
        font-size: 13px;
    }

    .list-view .char-item-list .char-value {
        font-size: 14px;
        line-height: 15px;
        transform: translateY(-2px);
        font-weight: 600;
    }

    /* Shortcode mobile */
    .case-shortcode-container .case-image {
        height: 160px;
    }

    .case-shortcode-container .case-content {
        padding: 0px;
    }

    .case-shortcode-container .case-title {
        font-size: 14px;
    }

    .case-shortcode-container .case-features {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .case-shortcode-container .case-button {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Lista View - Very small screens */
    .list-view .case-footer-left {
        flex-direction: column;
        gap: 12px;
    }

    .list-view .case-footer-item {
        min-width: 80px;
        align-items: center;
        justify-content: center;
        display: flex;
        flex-direction: column;
    }

    .list-view .case-footer-button {
        font-size: 13px;
        padding: 10px 16px;
    }
}