/* ==========================================================================
   SVM Land Promoters - Exclusive Offers Responsive Styles
   ========================================================================== */

/* --- Desktop & Laptop Adaptive Refinements (1440px - 1200px) --- */
@media (max-width: 1440px) {
    :root {
        --container-width: 1140px;
    }
}

@media (max-width: 1200px) {
    :root {
        --container-width: 960px;
        --spacing: 2rem;
    }
    
    .navbar-container {
        width: min(calc(100% - 2rem), var(--container-width));
    }
    
    .offer-card {
        /* Adjust column balance slightly for narrower desktop/laptops */
        grid-template-columns: minmax(0, 55%) minmax(320px, 45%);
    }
}

/* --- Tablet Adaptations (1024px - 768px) --- */
@media (max-width: 1024px) {
    :root {
        --container-width: 720px;
    }
    
    .offer-card {
        /* Keep two-column layout on iPad/Tablet portrait by adapting sizes */
        grid-template-columns: minmax(0, 52%) minmax(280px, 48%);
        --spacing: 1.5rem;
    }
    
    .price-date-row {
        gap: 0.75rem;
    }
    
    .benefits-list {
        gap: 0.5rem 1rem;
    }
}

/* Stack Layout Breakpoint (Switch at 992px to prevent narrow column overflow) */
@media (max-width: 992px) {
    :root {
        --container-width: 100%;
        --spacing: clamp(1.25rem, 4vw, 2rem);
    }
    
    .main-content {
        margin-top: calc(75px + 3rem);
        width: min(calc(100% - 2rem), 720px); /* Center stacked layout nicely */
    }
    
    .offer-card {
        grid-template-columns: 1fr; /* Stack: Image top, Content bottom */
        border-radius: var(--card-radius);
    }
    
    .card-media {
        aspect-ratio: 16 / 9;
        height: auto;
    }
    
    .card-image {
        object-fit: cover;
    }
    
    .price-date-row {
        grid-template-columns: repeat(3, 1fr); /* Reset back to 3-column */
        gap: 1.25rem;
    }
    
    .benefits-list {
        gap: 0.6rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        width: min(calc(100% - 2rem), 540px); /* Adjust content width */
    }
    
    .price-date-row {
        /* 3 columns gets tight under 768px, split into price on top, dates sharing a row */
        grid-template-columns: 1.2fr 1fr;
        gap: 1rem;
    }
    
    .price-block {
        grid-column: span 2;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0.75rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .type-badge {
        order: -1; /* Place badge above title on mobile layout for better reading hierarchy */
    }
}

/* --- Mobile Viewports (480px - 320px) --- */
@media (max-width: 576px) {
    .main-content {
        width: calc(100% - 1.5rem);
        margin-top: calc(70px + 2rem);
        margin-bottom: 3rem;
    }
    
    .navbar-container {
        top: 1rem;
        width: calc(100% - 1.5rem);
    }
    
    .navbar {
        padding: 0.5rem 1.25rem;
        border-radius: 30px;
    }
    
    .logo-img {
        height: 38px;
    }
    
    .company-name {
        font-size: 0.95rem;
    }
    
    .company-tagline {
        font-size: 0.65rem;
        margin-top: 0.05rem;
    }
    
    /* Hide tagline and shrink name further on very small mobile to fit without stretching navbar */
    @media (max-width: 480px) {
        .company-name {
            font-size: 0.85rem;
        }
        .company-tagline {
            display: none;
        }
        .logo-img {
            height: 32px;
        }
        .navbar-logo {
            gap: 0.5rem;
        }
    }
    
    .menu-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    /* Hero Title and Badge margin compression */
    .hero-section {
        margin-bottom: 2rem;
    }
    
    .exclusive-badge {
        margin-bottom: 0.75rem;
        padding: 0.4rem 1rem;
    }
    
    .hero-subtitle-container {
        gap: 0.5rem;
    }
    
    .decorative-line {
        display: none; /* Hide subtitle lines on very small displays for text width space */
    }
    
    /* Card structural adjustments for mobile */
    .offer-card {
        border-radius: 18px; /* Slightly tighter border-radius for mobile screens */
    }
    
    .card-media {
        aspect-ratio: 16 / 9;
    }
    
    .card-image {
        object-fit: cover;
    }
    
    /* Image overlay details */
    .image-badge {
        top: 1rem;
        left: 1rem;
        padding: 0.4rem 0.85rem;
    }
    
    /* Price and Dates Stack on Mobile */
    .price-date-row {
        grid-template-columns: 1fr; /* Full stack */
        gap: 0.85rem;
    }
    
    .price-block {
        grid-column: span 1;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0.85rem;
    }
    
    .date-block {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed rgba(226, 232, 240, 0.7);
        padding-bottom: 0.5rem;
    }
    
    .date-block:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .date-block .info-label {
        margin-bottom: 0;
    }
    
    /* Benefits stack */
    .benefits-list {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* CTA buttons stack vertically and take full width */
    .card-actions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        padding: 0.85rem 1rem;
    }
}

/* Extra Small Mobile (320px - 375px) */
@media (max-width: 360px) {
    .offer-title {
        font-size: 1.4rem;
    }
    
    .company-name {
        font-size: 0.75rem;
    }
    
    .price-value {
        font-size: 1.4rem;
    }
    
    .modal-close {
        top: -3.5rem;
        right: 0.5rem;
    }
}

/* --- Closing CTA Responsive Styling --- */
@media (max-width: 768px) {
    .closing-cta {
        margin-top: 32px;
        padding: 0;
    }
    
    .cta-container {
        width: 100%;
        max-width: 100%;
        margin-inline: auto;
        border-radius: 28px;
        padding-top: clamp(30px, 5vw, 42px);
        padding-bottom: clamp(36px, 5vw, 48px);
        padding-left: max(var(--spacing), env(safe-area-inset-left));
        padding-right: max(var(--spacing), env(safe-area-inset-right));
    }
    
    .cta-heading {
        font-size: 32px !important;
        max-width: 100%;
    }
    
    .cta-subtitle {
        font-size: 1.05rem;
        max-width: 100%;
    }
    
    .cta-cards {
        width: 100%;
        gap: clamp(16px, 2.5vw, 22px);
        grid-template-columns: 1fr;
        margin-bottom: clamp(16px, 2.5vw, 22px);
    }
    
    .cta-card, .cta-call-card {
        min-height: auto;
        padding: clamp(18px, 3vw, 24px);
        border-radius: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        max-width: 100%;
        box-shadow: var(--shadow-soft);
    }
    
    .cta-call-card {
        margin: 0 auto clamp(24px, 4vw, 36px);
    }
    
    .card-icon-wrapper {
        width: 54px;
        height: 54px;
        font-size: 22px;
        margin-bottom: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .card-icon-wrapper i {
        font-size: 22px;
    }
    
    .card-cta-title {
        font-size: 1.45rem;
    }
    
    .card-cta-desc {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.25rem;
    }
    
    .cta-card .btn, .cta-call-card .btn {
        width: min(100%, 280px) !important;
        min-height: 52px;
        height: auto;
        padding: 12px 24px;
        font-size: 14px;
        margin-inline: auto;
    }
    
    .cta-trust-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
        padding-top: 1.75rem;
    }
    
    .stat-item {
        width: 100%;
        gap: 0.25rem;
    }
    
    .stat-icon-wrapper {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .stat-item::after {
        display: none !important;
    }
}

/* Extra overrides for narrow mobile screens */
@media (max-width: 480px) {
    .cta-heading {
        font-size: 26px !important;
    }
    .cta-subtitle {
        font-size: 0.95rem;
    }
}

@media (max-width: 375px) {
    .cta-heading {
        font-size: 23px !important;
    }
    .card-cta-title {
        font-size: 1.3rem;
    }
    .card-cta-desc {
        font-size: 0.9rem;
    }
}

/* --- Tablet Landscape Closing CTA Styling (769px - 1100px) --- */
@media (min-width: 769px) and (max-width: 1100px) {
    .cta-container {
        padding: 32px var(--spacing) 40px;
    }
    
    .cta-cards {
        width: 100%;
        max-width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch; /* Stretch cards to equal height */
        gap: clamp(20px, 2.5vw, 28px);
        margin-bottom: 24px;
    }
    
    .cta-card {
        display: flex;
        flex-direction: column;
        height: 100%; /* Stretch inside grid cell */
        min-height: auto;
        padding: clamp(20px, 3vw, 28px) clamp(16px, 2.5vw, 24px);
        border-radius: 20px;
        box-sizing: border-box;
    }
    
    .cta-call-card {
        margin: 24px auto 32px;
        width: min(100%, 520px);
        min-height: auto;
        padding: clamp(20px, 3vw, 28px) clamp(16px, 2.5vw, 24px);
        border-radius: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        box-sizing: border-box;
    }
    
    .card-icon-wrapper {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 1rem;
        flex-shrink: 0;
    }
    
    .card-cta-title {
        margin-bottom: 0.5rem;
        font-size: clamp(28px, 2.8vw, 34px);
    }
    
    .card-cta-desc {
        max-width: none;
        margin-bottom: 1.25rem;
        font-size: clamp(15px, 1.6vw, 18px);
        flex-grow: 1; /* Grow text area to fill vertical space */
        text-align: center;
    }
    
    .cta-card .btn, .cta-call-card .btn {
        width: min(100%, 280px) !important;
        min-height: 52px;
        height: auto;
        padding: 12px 24px;
        font-size: 14px;
        margin-inline: auto;
        margin-top: auto; /* Push to bottom */
        flex-shrink: 0;
    }
}

/* --- Short Landscape Viewport Spacing & Proportion Optimization (min-width: 900px) and (max-height: 700px) --- */
@media (min-width: 900px) and (max-height: 700px) {
    .main-content {
        margin-top: calc(75px + 1.5rem);
        margin-bottom: 1.5rem;
    }
    
    .hero-section {
        margin-bottom: 1.25rem;
    }
    
    .hero-title {
        margin-bottom: 0.25rem;
    }
    
    .offer-card {
        --spacing: clamp(0.75rem, 1.8vw, 1.15rem);
        min-height: auto;
    }
    
    .card-media {
        aspect-ratio: auto;
        height: 100%;
    }
    
    .card-content {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        height: 100%;
        box-sizing: border-box;
    }
    
    .card-header {
        margin-bottom: 0.25rem;
    }
    
    .offer-title {
        font-size: clamp(1.4rem, 2vw, 1.7rem);
    }
    
    .project-details {
        margin-bottom: 0.25rem;
    }
    
    .content-divider {
        margin-bottom: 0.5rem;
    }
    
    .price-date-row {
        margin-bottom: 0.5rem;
        gap: 0.5rem;
    }
    
    .info-label {
        margin-bottom: 0.25rem;
        font-size: 0.7rem;
    }
    
    .price-value {
        font-size: clamp(1.3rem, 1.8vw, 1.5rem);
    }
    
    .date-value {
        font-size: 0.85rem;
    }
    
    .benefits-container {
        margin-bottom: 0.5rem;
    }
    
    .benefits-list {
        gap: 0.3rem 0.75rem;
    }
    
    .benefit-item {
        font-size: 0.8rem;
    }
    
    .card-actions {
        margin-top: auto;
        gap: 0.5rem;
    }
    
    .btn {
        width: min(100%, 280px);
        min-height: 44px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Closing CTA Compressions */
    .closing-cta {
        margin-top: 1.5rem;
    }
    
    .cta-container {
        padding: 20px var(--spacing) 24px;
    }
    
    .cta-cards {
        gap: 16px;
        margin-bottom: 12px;
    }
    
    .cta-card, .cta-call-card {
        padding: 14px 18px;
    }
    
    .cta-call-card {
        margin: 14px auto 18px;
    }
    
    .card-icon-wrapper {
        width: 44px;
        height: 44px;
        font-size: 18px;
        margin-bottom: 0.75rem;
    }
    
    .card-cta-title {
        font-size: clamp(22px, 2.2vw, 26px);
    }
    
    .card-cta-desc {
        font-size: clamp(14px, 1.4vw, 16px);
        margin-bottom: 0.75rem;
    }
    
    .cta-card .btn, .cta-call-card .btn {
        width: min(100%, 280px) !important;
        min-height: 46px;
        font-size: 13px;
        margin-top: auto;
    }
}
