/* ==============================================================
   UNIVERSAL BUSINESS · MASTER RESPONSIVE & ADAPTIVE STYLESHEET
   Mobile-First & Adaptive Breakpoints for All Devices & Screens
   Viewports: 320px, 360px, 375px, 390px, 414px, 480px, 640px, 768px, 992px, 1024px, 1280px+
   ============================================================== */

/* ==============================================================
   1. GLOBAL RESET & MOBILE-FIRST FOUNDATIONS
   ============================================================== */
:root {
    /* Responsive Viewport Spacing & Sizing Tokens */
    --container-padding: clamp(1rem, 3.5vw, 1.5rem);
    --header-height-mobile: 64px;
    --header-height-desktop: 80px;
    --touch-target-min: 44px;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    min-width: 320px;
    -webkit-tap-highlight-color: transparent;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Prevent Media from Overflowing Container Bounds */
img, svg, video, canvas, iframe {
    max-width: 100%;
    height: auto;
}

/* Prevent text overflow in containers */
h1, h2, h3, h4, h5, h6, p, span, a, li {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Ensure smooth button & link touch areas */
button, a, input, textarea, select {
    touch-action: manipulation;
}

/* Mobile Safari fix: font-size >= 16px prevents iOS auto-zoom on input focus */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Container safety on small viewports */
.container {
    width: 100%;
    max-width: var(--container-max, 1280px);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    box-sizing: border-box;
}

/* ==============================================================
   2. SITE HEADER & NAVIGATION (MOBILE-FIRST)
   ============================================================== */
.site-header {
    height: var(--header-height, 80px);
    transition: background 0.3s ease, height 0.3s ease, box-shadow 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
}

/* Accessible Touch Targets for Header Actions */
.action-icon {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Burger Toggle Button - Always Accessible & Animated */
.burger-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1051;
}

.burger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-white, #fff);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

/* Hamburger overlay mobile drawer */
.burger-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-burger, 1050);
    background: rgba(8, 7, 6, 0.94);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.burger-overlay.open {
    opacity: 1;
    visibility: visible;
}

.burger-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100%;
    height: 100dvh;
    background: #0d0b08;
    border-left: 1px solid var(--border-gold, rgba(217, 180, 90, 0.25));
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -15px 0 40px rgba(0,0,0,0.7);
}

.burger-overlay.open .burger-menu {
    transform: translateX(0);
}

.burger-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(217, 180, 90, 0.15);
    margin-bottom: 15px;
}

.burger-brand {
    font-family: var(--font-display, serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-white, #fff);
    background: linear-gradient(135deg, #fff 40%, var(--gold-light, #f2dba4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.burger-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(217, 180, 90, 0.2);
    border-radius: 50%;
    color: var(--color-white, #fff);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.burger-close:hover,
.burger-close:focus {
    background: rgba(217, 180, 90, 0.15);
    border-color: var(--gold-primary, #d9b45a);
    color: var(--gold-light, #f2dba4);
}

.burger-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.burger-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--text-secondary, #ad9e87);
    font-size: 1.05rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.burger-nav a:hover,
.burger-nav a:active,
.burger-nav a.active {
    color: var(--color-white, #fff);
    background: rgba(217, 180, 90, 0.08);
    border-color: rgba(217, 180, 90, 0.2);
    transform: translateX(4px);
}

.burger-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    color: var(--text-muted, #736756);
    font-size: 0.78rem;
    line-height: 1.5;
}

/* ==============================================================
   3. LARGE TABLET / SMALL LAPTOP BREAKPOINT (<= 1024px)
   ============================================================== */
@media (max-width: 1024px) {
    .site-header {
        height: var(--header-height-mobile, 64px);
    }
    
    :root {
        --header-height: 64px;
    }

    .nav-primary {
        display: none !important;
    }

    .burger-toggle {
        display: flex;
    }

    /* Hero Responsive */
    .hero-section {
        padding: calc(var(--header-height) + 2.5rem) 0 3.5rem;
        min-height: auto;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .hero-text {
        max-width: 100%;
        margin: 0 auto;
    }

    .hero-title {
        font-size: clamp(2.1rem, 5.5vw, 3.4rem);
        line-height: 1.15;
    }

    .hero-subtitle {
        max-width: 620px;
        margin-left: auto;
        margin-right: auto;
        font-size: clamp(1rem, 2vw, 1.2rem);
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        max-width: 650px;
        margin: 0 auto;
        width: 100%;
    }

    /* Grids */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* M.A.G.I.C. Offers */
    .pricing-cards-grid {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
        gap: 28px;
    }

    .pricing-card.flagship {
        transform: none !important;
    }

    .pricing-card.flagship:hover {
        transform: translateY(-4px) !important;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .bonuses-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .guarantee-box {
        flex-direction: column;
        text-align: center;
        gap: 24px;
        padding: 30px;
    }

    .guarantee-seal {
        margin: 0 auto;
    }

    .roi-results-box {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 20px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .newsletter-form {
        max-width: 500px;
        margin: 0 auto;
    }
}

/* ==============================================================
   4. TABLET & PHABLET BREAKPOINT (<= 768px)
   ============================================================== */
@media (max-width: 768px) {
    :root {
        --font-size-5xl: 2.3rem;
        --font-size-4xl: 1.95rem;
        --font-size-3xl: 1.6rem;
        --font-size-2xl: 1.35rem;
        --font-size-xl: 1.2rem;
        --container-padding: 1.15rem;
    }

    /* Header brand & actions */
    .brand .logo-text {
        font-size: 1.3rem;
    }

    .brand .logo-icon {
        font-size: 1.4rem;
    }

    .header-actions {
        gap: 0.35rem;
    }

    .action-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }

    /* Hero Section */
    .hero-section {
        padding: calc(var(--header-height) + 1.8rem) 0 2.5rem;
    }

    .hero-tag {
        font-size: 0.72rem;
        padding: 0.35rem 0.8rem;
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: clamp(1.85rem, 5.8vw, 2.6rem);
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 0.98rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        gap: 0.75rem;
        width: 100%;
    }

    .hero-cta .btn-primary,
    .hero-cta .btn-secondary {
        min-height: 48px;
        padding: 0.75rem 1.4rem;
        font-size: 0.95rem;
    }

    /* Hero Stats */
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .stat-item {
        padding: 1rem 0.6rem;
    }

    .stat-number {
        font-size: 1.7rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Visitors Bar */
    .visitors-bar {
        padding: 1rem 0;
    }

    .visitors-grid {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .visitor-box {
        font-size: 0.88rem;
    }

    /* Services & Features */
    .services-section,
    .shop-preview,
    .reviews-section,
    .faq-section,
    .contact-section {
        padding: 3rem 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .section-sub {
        font-size: 0.95rem;
    }

    /* M.A.G.I.C. Offer Sections */
    .magic-offer-section {
        padding: 3.5rem 0;
    }

    .magic-header {
        margin-bottom: 35px;
    }

    .magic-title {
        font-size: clamp(1.75rem, 5.2vw, 2.4rem);
    }

    .magic-sub {
        font-size: 0.98rem;
    }

    .comparison-wrapper {
        padding: 24px 18px;
        margin-bottom: 40px;
    }

    .comparison-header h3 {
        font-size: 1.35rem;
    }

    .comp-col {
        padding: 18px 14px;
    }

    .comp-list li {
        font-size: 0.88rem;
        gap: 10px;
    }

    .pricing-cards-grid {
        gap: 24px;
        margin-bottom: 45px;
    }

    .pricing-card {
        padding: 30px 22px;
    }

    .tier-name {
        font-size: 1.35rem;
    }

    .actual-price .amount {
        font-size: 2.3rem;
    }

    .bonuses-container {
        padding: 26px 18px;
        margin-bottom: 40px;
    }

    .bonuses-header h3 {
        font-size: 1.4rem;
    }

    .bonus-item {
        padding: 18px;
    }

    .guarantee-box {
        padding: 24px 16px;
        margin-bottom: 40px;
    }

    .guarantee-seal {
        width: 90px;
        height: 90px;
    }

    .seal-days {
        font-size: 1.3rem;
    }

    .guarantee-text h4 {
        font-size: 1.25rem;
    }

    .guarantee-text p {
        font-size: 0.88rem;
    }

    .roi-calculator {
        padding: 24px 16px;
    }

    .roi-title {
        font-size: 1.35rem;
        margin-bottom: 20px;
    }

    .roi-results-box {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .roi-res-num {
        font-size: 1.5rem;
    }

    .scarcity-bar {
        font-size: 0.82rem;
        padding: 10px 18px;
        border-radius: 12px;
    }

    /* FAQ */
    .faq-question {
        padding: 1.1rem 1.25rem;
        font-size: 0.95rem;
    }

    .faq-answer {
        font-size: 0.9rem;
    }

    .faq-item.open .faq-answer {
        padding: 0 1.25rem 1.1rem;
    }

    /* Newsletter & Contact */
    .newsletter-form {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .newsletter-form input {
        width: 100%;
        min-height: 48px;
    }

    .newsletter-form .btn-primary {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-brand p {
        max-width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    /* Cookie Banner */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .cookie-actions button {
        width: 100%;
        min-height: 44px;
    }
}

/* ==============================================================
   5. SMARTPHONE BREAKPOINT (<= 480px)
   ============================================================== */
@media (max-width: 480px) {
    :root {
        --container-padding: 0.9rem;
    }

    /* Header Compact */
    .logo-link {
        gap: 0.35rem;
    }

    .brand .logo-text {
        font-size: 1.15rem;
    }

    .brand .logo-icon {
        font-size: 1.25rem;
    }

    .burger-menu {
        max-width: 100%;
    }

    /* Hero CTA Full Width Stack */
    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn-primary,
    .hero-cta .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Hero Stats stacked cleanly or 3 compact columns */
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .stat-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.85rem 1.25rem;
        text-align: left;
    }

    .stat-number {
        font-size: 1.6rem;
        margin-bottom: 0;
    }

    .stat-label {
        margin-top: 0;
        font-size: 0.85rem;
    }

    /* Single Column Grids for Total Readability */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .reviews-slider {
        grid-template-columns: 1fr;
    }

    /* Pricing card tweaks */
    .pricing-card {
        padding: 24px 16px;
    }

    .actual-price .amount {
        font-size: 2.1rem;
    }

    .btn-magic-cta {
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ribbon-best-value {
        font-size: 0.68rem;
        padding: 4px 14px;
        top: -12px;
    }

    /* Cortex Chat Specifics */
    .cortex-chat-page .chat-header h1 {
        font-size: 1.4rem;
    }

    .cortex-chat-page .chat-container {
        height: calc(100dvh - 200px);
        min-height: 380px;
        padding: 12px;
    }

    .message {
        max-width: 95%;
    }

    /* Cortex Dashboard */
    .cortex-dashboard .stats-grid {
        grid-template-columns: 1fr;
    }

    .cortex-dashboard .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================================================
   6. EXTRA COMPACT SCREENS (<= 360px - e.g. Galaxy Fold, older devices)
   ============================================================== */
@media (max-width: 360px) {
    .brand .logo-text {
        font-size: 1.05rem;
    }

    .header-actions {
        gap: 0.2rem;
    }

    .action-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .hero-title {
        font-size: 1.65rem;
    }

    .actual-price .amount {
        font-size: 1.85rem;
    }
}

/* ==============================================================
   7. HIGH-RESOLUTION / RETINA & DARK MODE ENHANCEMENTS
   ============================================================== */
@media (hover: hover) and (pointer: fine) {
    /* Smooth hover transitions only for pointer devices */
    .pricing-card:hover {
        transform: translateY(-6px);
    }
    .service-card:hover {
        transform: translateY(-4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
