/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #0f172a;
    --accent: #818cf8;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #334155;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 100%;
}

/* Global Resets */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Fluid Typography */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 0.5em;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

/* Forms & Inputs */
input,
select,
textarea {
    font-family: inherit;
    font-size: 1rem;
    /* Prevent zoom on iOS */
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    width: 100%;
    min-height: 48px;
    /* Touch target */
    margin-bottom: 1rem;
}

/* Utilities */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
    /* Mobile padding */
}

/* Responsive Container max-widths */
@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
        padding: 0 1.5rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    min-height: 48px;
    /* Touch target size */
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    gap: 0.5rem;
    width: 100%;
    /* Mobile default: full width */
}

@media (min-width: 640px) {
    .btn {
        width: auto;
        /* Desktop: natural width */
    }
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -1px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    box-shadow: none;
    border: 1px solid transparent;
}

.btn-secondary:hover {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: none;
}

.section-title {
    font-size: 1.75rem;
    /* Mobile smaller heading */
    color: var(--secondary);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.25rem;
    }
}

/* Header */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.75rem 0;
}

.navbar {
    display: flex;
    flex-direction: column;
    /* Mobile: Stacked */
    gap: 1rem;
    align-items: center;
}

@media (min-width: 768px) {
    .navbar {
        flex-direction: row;
        /* Desktop: Row */
        justify-content: space-between;
    }
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    text-decoration: none;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem;
    /* Hit area */
}

.nav-link:hover {
    color: var(--primary);
}

.cart-count {
    background-color: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-left: 0.25rem;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    /* Mobile Less padding */
    text-align: center;
    background: linear-gradient(to bottom right, var(--surface), rgba(79, 70, 229, 0.1));
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .hero {
        padding: 6rem 0;
    }
}

.hero h1 {
    font-size: 2.5rem;
    /* Mobile size */
    color: var(--secondary);
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 3.5rem;
        /* Desktop size */
        margin-bottom: 1.5rem;
    }
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 600px;
    /* Applies if screen is wide enough */
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .hero p {
        font-size: 1.25rem;
        margin-bottom: 2.5rem;
    }
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile: 1 col */
    gap: 1.5rem;
    margin-bottom: 4rem;
    text-align: center;
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Tablet: 2 col */
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Desktop: 4 col */
        gap: 2rem;
    }
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: inline-block;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile: 1 col */
    gap: 1.5rem;
    padding-bottom: 4rem;
}

@media (min-width: 500px) {

    /* Small Tablet / Large Phone */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: calc(var(--radius) - 0.25rem);
    margin-bottom: 1rem;
    background-color: var(--background);
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.product-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    flex-direction: column;
    /* Mobile: Stack price and buy button */
    gap: 1rem;
    margin-top: auto;
}

@media (min-width: 400px) {
    .product-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Newsletter */
.newsletter {
    background: var(--secondary);
    color: white;
    padding: 3rem 1.5rem;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .newsletter {
        padding: 4rem 0;
    }
}

.newsletter-content {
    position: relative;
    z-index: 10;
}

.newsletter h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .newsletter h2 {
        font-size: 2rem;
    }
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    /* Mobile: Stacked */
    gap: 0.75rem;
    justify-content: center;
    max-width: 500px;
    margin: 2rem auto 0;
}

@media (min-width: 640px) {
    .newsletter-form {
        flex-direction: row;
        /* Tablet+: Row */
        gap: 0.5rem;
    }
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: none;
    font-family: inherit;
    min-height: 48px;
}

/* Footer */
footer {
    background-color: var(--secondary);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* Block System Support */
/* Note: Individual blocks control their own spacing via margin_top/margin_bottom settings */
.block {
    box-sizing: border-box;
}


/* Mobile Navigation System */
.mobile-menu-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text);
    z-index: 100;
}

.mobile-menu-toggle svg {
    width: 28px;
    height: 28px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    /* Off-canvas Menu Base */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden by default */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--surface);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem !important;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        z-index: 99;
        padding: 2rem;
    }

    /* Open State */
    .nav-links.nav-open {
        right: 0;
    }

    /* Backdrop */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 98;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Utility for stacking grids on mobile */
.grid-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-stack {
        grid-template-columns: repeat(2, 1fr);
    }
}

.footer-content op {
    opacity: 0.8;

    /* Interaction & Accessibility */
    :focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

    /* Loading States */
    .is-loading {
        position: relative;
        pointer-events: none;
        opacity: 0.7;
    }

    .is-loading::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 24px;
        height: 24px;
        margin: -12px 0 0 -12px;
        border: 3px solid rgba(0, 0, 0, 0.1);
        border-top-color: var(--primary);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        z-index: 10;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }
}

/* =========================================
   PAGE BUILDER BLOCKS (V2)
   ========================================= */

/* Hero Block */
.block-hero {
    position: relative;
    padding: 8rem 0;
    /* Even more padding */
    min-height: 600px;
    /* Force minimum height for 'half image' fix */
    background-color: var(--surface);
    overflow: hidden;
    color: var(--text);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-hero--image {
    color: white !important;
    /* Force white text */
}

/* Gradient variant */
.block-hero--gradient {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
}

.block-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    /* Darker overlay for better contrast */
    z-index: 1;
    display: none;
}

.block-hero--image .block-hero__overlay {
    display: block;
}

.block-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

.block-hero__title {
    font-size: clamp(3rem, 6vw, 5rem);
    /* Larger title */
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: inherit;
    /* This will inherit white !important */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.block-hero__subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    margin-bottom: 2.5rem;
    opacity: 0.95;
    font-weight: 400;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: inherit;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.block-hero__actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.block-hero__button {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: transform 0.2s;
}

.block-hero__button:hover {
    transform: scale(1.05);
}

/* Feature Grid Block */
.block-feature-grid {
    padding: 5rem 0;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr !important;
    }
}

.feature-item {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-align: center;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.feature-item__icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.feature-item__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

.feature-item__desc {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Feature Item Variants */
.feature-item--vertical {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-item--horizontal {
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
}

.feature-item--horizontal .feature-item__icon {
    margin-bottom: 0;
    flex-shrink: 0;
    font-size: 3rem;
}

/* Product Grid Block */
.block-product-grid {
    padding: 4rem 0;
}

/* ============================================
   PHASE 1: ESSENTIAL CONTENT BLOCKS
   ============================================ */

/* Quote Block */
.block-quote {
    position: relative;
    padding: 2rem;
    margin: 2rem 0;
    font-size: 1.25rem;
    line-height: 1.6;
}

.block-quote__icon {
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.3;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.block-quote__content {
    font-style: italic;
    color: var(--text);
    margin: 0 0 1rem 0;
}

.block-quote__citation {
    display: block;
    font-size: 0.9rem;
    font-style: normal;
    color: var(--text-light);
    font-weight: 500;
}

/* Quote Variants */
.block-quote--simple {
    text-align: center;
    padding: 2rem 1rem;
}

.block-quote--bordered {
    border-left: 4px solid var(--primary);
    padding-left: 2rem;
    background: transparent;
}

.block-quote--bordered .block-quote__icon {
    display: none;
}

.block-quote--highlighted {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
    border-radius: var(--radius);
    text-align: center;
}

.block-quote--modern {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border);
}

.block-quote--modern:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    transition: var(--transition);
}

/* ============================================
   PHASE 2: INTERACTIVE CONTENT BLOCKS
   ============================================ */

/* Accordion Block */
.block-accordion {
    margin: 1.5rem 0;
}

.block-accordion__item {
    margin-bottom: 0.5rem;
}

.block-accordion__header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    transition: var(--transition);
    font-family: inherit;
}

.block-accordion__header:hover {
    color: var(--primary);
}

.block-accordion__icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.block-accordion__item--open .block-accordion__icon {
    transform: rotate(180deg);
}

.block-accordion__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.block-accordion__item--open .block-accordion__content {
    max-height: 500px;
}

.block-accordion__body {
    padding: 0 1.25rem 1rem;
    color: var(--text);
    line-height: 1.6;
}

/* Accordion Variants */
.block-accordion--minimal .block-accordion__header {
    border-bottom: 1px solid var(--border);
}

.block-accordion--bordered .block-accordion__item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.block-accordion--filled .block-accordion__header {
    background: var(--background);
    border-radius: var(--radius);
}

.block-accordion--filled .block-accordion__item--open .block-accordion__header {
    background: var(--primary);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
}

.block-accordion--filled .block-accordion__item--open .block-accordion__icon {
    color: white;
}

/* Tabs Block */
.block-tabs {
    margin: 1.5rem 0;
}

.block-tabs__nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.block-tabs__tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
    font-family: inherit;
}

.block-tabs__tab:hover {
    color: var(--primary);
}

.block-tabs__tab--active {
    color: var(--primary);
}

.block-tabs__panel {
    display: none;
    padding: 1.5rem;
    line-height: 1.6;
    color: var(--text);
}

.block-tabs__panel--active {
    display: block;
}

/* Tabs Variants */
.block-tabs--underline .block-tabs__nav {
    border-bottom: 2px solid var(--border);
}

.block-tabs--underline .block-tabs__tab {
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.block-tabs--underline .block-tabs__tab--active {
    border-bottom-color: var(--primary);
}

.block-tabs--pills .block-tabs__tab {
    border-radius: 50px;
    background: var(--background);
}

.block-tabs--pills .block-tabs__tab--active {
    background: var(--primary);
    color: white;
}

.block-tabs--boxed .block-tabs__nav {
    background: var(--background);
    padding: 0.25rem;
    border-radius: var(--radius);
}

.block-tabs--boxed .block-tabs__tab {
    border-radius: calc(var(--radius) - 2px);
}

.block-tabs--boxed .block-tabs__tab--active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   PHASE 3: LAYOUT BLOCKS
   ============================================ */

/* Columns Block */
.block-columns {
    margin: 1.5rem 0;
}

@media (max-width: 768px) {
    .block-columns {
        grid-template-columns: 1fr !important;
    }
}

.block-columns__col {
    min-width: 0;
}

/* Gallery Block */
.block-gallery__item {
    overflow: hidden;
    border-radius: 8px;
    transition: var(--transition);
}

.block-gallery__item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

.block-gallery__item img {
    transition: var(--transition);
}

.block-gallery__item:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .block-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Cards Block */
.block-cards__card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.block-cards__card:hover {
    transform: translateY(-4px);
}

.block-cards__image img {
    border-radius: var(--radius) var(--radius) 0 0;
}

.block-cards__content {
    padding: 1.25rem;
    flex: 1;
}

.block-cards__title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--secondary);
    margin: 0 0 0.5rem 0;
}

.block-cards__desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

/* Cards Variants */
.block-cards--elevated .block-cards__card {
    background: var(--surface);
    box-shadow: var(--shadow);
}

.block-cards--elevated .block-cards__card:hover {
    box-shadow: var(--shadow-lg);
}

.block-cards--bordered .block-cards__card {
    background: var(--surface);
    border: 1px solid var(--border);
}

.block-cards--bordered .block-cards__card:hover {
    border-color: var(--primary);
}

.block-cards--flat .block-cards__card {
    background: var(--background);
}

@media (max-width: 768px) {
    .block-cards {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   PHASE 5: UTILITY BLOCKS
   ============================================ */

/* Contact Form Block */
.block-contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.block-contact-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .block-contact-form__row {
        grid-template-columns: 1fr;
    }
}

.block-contact-form__field {
    margin-bottom: 1rem;
}

.block-contact-form__field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.block-contact-form__field input,
.block-contact-form__field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.block-contact-form__field input:focus,
.block-contact-form__field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Form Style Variants */
.block-contact-form--modern {
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.block-contact-form--minimal {
    padding: 0;
    background: transparent;
}

.block-contact-form--boxed {
    padding: 2rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
}

/* ============================================
   MOBILE OPTIMIZATION UTILITIES
   ============================================ */

/* ----- Layout Containers ----- */

/* Checkout Layout: Side-by-side on desktop, stacked on mobile */
.checkout-layout {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.checkout-layout>.checkout-form {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.checkout-layout>.checkout-summary {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    background: var(--background);
    padding: 2rem;
    border-radius: var(--radius);
}

@media (max-width: 768px) {
    .checkout-layout {
        flex-direction: column;
        gap: 1.5rem;
    }

    .checkout-layout>.checkout-form,
    .checkout-layout>.checkout-summary {
        min-width: 100%;
        max-width: 100%;
        padding: 1.25rem;
    }
}

/* Account Layout: Sidebar + content grid */
.account-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
}

.account-sidebar {
    position: sticky;
    top: 100px;
}

.account-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-content {
    min-width: 0;
}

@media (max-width: 768px) {
    .account-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .account-sidebar {
        position: static;
    }

    .account-sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.25rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .account-sidebar nav a {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Product Layout: Image + info side-by-side */
.product-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.product-layout>.product-gallery {
    flex: 1;
    min-width: 280px;
}

.product-layout>.product-details {
    flex: 1;
    min-width: 280px;
}

@media (max-width: 768px) {
    .product-layout {
        flex-direction: column;
        gap: 2rem;
    }

    .product-layout>.product-gallery,
    .product-layout>.product-details {
        min-width: 100%;
    }
}

/* ----- Form Grids ----- */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
    margin-bottom: 0;
}

/* ----- Cart Responsive Styles ----- */

.cart-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.cart-table th,
.cart-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.cart-table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-light);
}

/* Mobile Cart Cards (Alternative to table) */
.cart-mobile-cards {
    display: none;
}

@media (max-width: 640px) {
    .cart-table-wrapper {
        display: none;
    }

    .cart-mobile-cards {
        display: block;
    }

    .cart-mobile-card {
        background: white;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .cart-mobile-card__header {
        display: flex;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .cart-mobile-card__image {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 8px;
        border: 1px solid var(--border);
    }

    .cart-mobile-card__info {
        flex: 1;
    }

    .cart-mobile-card__name {
        font-weight: 600;
        color: var(--secondary);
        margin-bottom: 0.25rem;
    }

    .cart-mobile-card__price {
        color: var(--primary);
        font-weight: 600;
    }

    .cart-mobile-card__footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 1rem;
        border-top: 1px dashed var(--border);
    }

    .cart-mobile-card__qty {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .cart-mobile-card__qty input {
        width: 50px;
        text-align: center;
        margin: 0;
    }
}

/* Cart Actions */
.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.cart-actions__buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cart-total-box {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    min-width: 280px;
}

@media (max-width: 640px) {
    .cart-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-actions__buttons {
        order: 2;
        flex-direction: column;
    }

    .cart-actions__buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .cart-total-box {
        order: 1;
        min-width: 100%;
    }
}

/* ----- Mobile Visibility Utilities ----- */

.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-full-width {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .mobile-stack {
        flex-direction: column !important;
    }

    .mobile-gap-sm {
        gap: 1rem !important;
    }

    .mobile-text-center {
        text-align: center !important;
    }

    .mobile-p-0 {
        padding: 0 !important;
    }

    .mobile-px-1 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ----- Gallery Improvements ----- */

.product-gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

.product-gallery-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.product-gallery-thumbnails::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 2px;
}

.product-gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.product-gallery-thumb {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.product-gallery-thumb:hover,
.product-gallery-thumb.active {
    border-color: var(--primary);
    border-width: 2px;
}

/* ----- Additional Mobile Enhancements ----- */

@media (max-width: 768px) {

    /* Reduce container padding on mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Adjust page padding */
    .page-content {
        padding: 2rem 0;
    }

    /* Navbar mobile improvements */
    .navbar {
        padding: 0.5rem 0;
    }

    /* Improve touch targets for links */
    .nav-link {
        padding: 0.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Button full-width on mobile in forms */
    form .btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Heading sizes on mobile */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Improve spacing in sections */
    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    /* Order summary improvements */
    .order-summary-list li {
        font-size: 0.9rem;
    }
}