/* ============================================================================
   MK Universal Catalog Pro V1
   Theme: 01 - Apple Minimal
   File: themes/theme01/assets/css/style.css
   Purpose: Complete design system for this theme. Mobile-first. Every other
            template file in this theme relies on the classes/variables
            defined here — this file must load before any page content.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   Changing these values re-themes every page instantly, without touching
   any template markup.
   ---------------------------------------------------------------------------- */
:root {
    /* Color palette - restrained, premium, high contrast */
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f7;
    --color-text: #1d1d1f;
    --color-text-muted: #6e6e73;
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-border: #d2d2d7;
    --color-success: #1d8a3e;
    --color-danger: #d70015;
    --color-white: #ffffff;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --fs-xs: 0.8125rem;
    --fs-sm: 0.9375rem;
    --fs-base: 1rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.75rem;
    --fs-2xl: 2.5rem;
    --fs-3xl: 3.5rem;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-7: 5rem;

    /* Radius & shadow */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);

    /* Layout */
    --max-width: 1200px;
    --header-height: 64px;
    --transition-fast: 0.18s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------------------------------------------
   2. RESET & BASE STYLES
   ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--fs-base);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: var(--fs-base); }

h1, h2, h3, h4 { margin: 0 0 var(--space-3); font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0 0 var(--space-3); color: var(--color-text-muted); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section { padding: var(--space-7) 0; }
.section-title {
    text-align: center;
    font-size: var(--fs-2xl);
    margin-bottom: var(--space-6);
}
.text-center { text-align: center; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   3. BUTTONS
   ---------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 1.75rem;
    border-radius: 999px;
    font-size: var(--fs-sm);
    font-weight: 500;
    border: 1px solid transparent;
    transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--color-accent);
    color: var(--color-white);
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-secondary {
    background: var(--color-bg-alt);
    color: var(--color-text);
}
.btn-secondary:hover { background: #e8e8ed; }

.btn-outline {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}
.btn-outline:hover { border-color: var(--color-text); }

.btn-whatsapp {
    background: #25d366;
    color: #fff;
}
.btn-whatsapp:hover { background: #20bd5a; }

.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8em; }

/* ----------------------------------------------------------------------------
   4. HEADER / NAVIGATION (glassmorphism, sticky)
   ---------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.site-logo {
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.main-nav {
    display: none;
}
.main-nav ul { display: flex; gap: var(--space-5); }
.main-nav a {
    font-size: var(--fs-sm);
    color: var(--color-text);
    transition: color var(--transition-fast);
}
.main-nav a:hover { color: var(--color-accent); }

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--color-text);
    transition: background var(--transition-fast);
}
.icon-btn:hover { background: var(--color-bg-alt); }

.mobile-menu-toggle {
    display: inline-flex;
}

/* Mobile off-canvas nav */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
    transform: translateX(100%);
    transition: transform var(--transition-base);
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav ul { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-6); }
.mobile-nav a { font-size: var(--fs-xl); }
.mobile-nav-close { align-self: flex-end; }

/* ----------------------------------------------------------------------------
   5. HERO / BANNER SLIDER
   ---------------------------------------------------------------------------- */
.hero-slider {
    position: relative;
    overflow: hidden;
    border-radius: 0;
}
.hero-slide {
    display: none;
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg-alt);
    padding: var(--space-6) var(--space-4);
}
.hero-slide.is-active { display: flex; }
.hero-slide-content { max-width: 640px; }
.hero-slide-content h2 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--space-3);
}
.hero-slide-content p {
    font-size: var(--fs-lg);
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.hero-dots {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
}
.hero-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(0,0,0,0.2);
    border: none;
    padding: 0;
}
.hero-dot.is-active { background: var(--color-accent); }

/* ----------------------------------------------------------------------------
   6. CATEGORY / BRAND GRIDS
   ---------------------------------------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.category-card, .brand-card {
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-4);
    text-align: center;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.category-card:hover, .brand-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.category-card img, .brand-card img {
    width: 64px; height: 64px; margin: 0 auto var(--space-3); border-radius: 50%;
    object-fit: cover; background: var(--color-white);
}
.category-card h3, .brand-card h3 { font-size: var(--fs-base); margin: 0; }

/* ----------------------------------------------------------------------------
   7. PRODUCT CARDS
   ---------------------------------------------------------------------------- */
.product-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.product-card-image {
    aspect-ratio: 1 / 1;
    background: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.product-badge {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    background: var(--color-accent);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}
.product-card-body {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}
.product-card-category {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.product-card-title {
    font-size: var(--fs-base);
    font-weight: 600;
    margin: 0;
}
.price-row { display: flex; align-items: baseline; gap: var(--space-2); margin-top: auto; }
.price-current { font-size: var(--fs-lg); font-weight: 700; }
.price-original { font-size: var(--fs-sm); color: var(--color-text-muted); text-decoration: line-through; }

/* ----------------------------------------------------------------------------
   8. PRODUCT DETAIL PAGE
   ---------------------------------------------------------------------------- */
.product-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}
.product-gallery-main {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-alt);
    margin-bottom: var(--space-3);
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-thumbs { display: flex; gap: var(--space-2); overflow-x: auto; }
.product-gallery-thumbs img {
    width: 72px; height: 72px; object-fit: cover;
    border-radius: var(--radius-sm); cursor: pointer;
    border: 2px solid transparent;
}
.product-gallery-thumbs img.is-active { border-color: var(--color-accent); }

.product-info-title { font-size: var(--fs-2xl); }
.product-info-meta { display: flex; gap: var(--space-3); font-size: var(--fs-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.product-info-price { font-size: var(--fs-2xl); font-weight: 700; margin-bottom: var(--space-4); }
.product-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-5); }

.spec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.spec-table tr { border-bottom: 1px solid var(--color-border); }
.spec-table td { padding: var(--space-3) 0; }
.spec-table td:first-child { color: var(--color-text-muted); width: 40%; }

.share-links { display: flex; gap: var(--space-2); }

/* ----------------------------------------------------------------------------
   9. GLASSMORPHISM UTILITY CARD (used on homepage feature blocks)
   ---------------------------------------------------------------------------- */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ----------------------------------------------------------------------------
   10. FORMS (contact page, search bar)
   ---------------------------------------------------------------------------- */
.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-size: var(--fs-sm); font-weight: 500; margin-bottom: var(--space-2); }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-alt);
    transition: border-color var(--transition-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    background: var(--color-white);
}

.search-bar { position: relative; max-width: 480px; margin: 0 auto; }
.search-bar input { padding-right: 3rem; }
.search-bar button {
    position: absolute; right: 4px; top: 4px; bottom: 4px;
    width: 40px; border: none; background: var(--color-accent);
    color: #fff; border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------------------------
   11. FOOTER
   ---------------------------------------------------------------------------- */
.site-footer {
    background: var(--color-bg-alt);
    padding: var(--space-6) 0 var(--space-4);
    margin-top: var(--space-7);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}
.footer-col h4 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.04em; }
.footer-col a { display: block; font-size: var(--fs-sm); color: var(--color-text-muted); padding: var(--space-1) 0; }
.footer-col a:hover { color: var(--color-text); }
.footer-social { display: flex; gap: var(--space-3); margin-top: var(--space-3); }
.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-4);
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

/* Floating WhatsApp button, present sitewide via footer.php */
.whatsapp-float {
    position: fixed;
    bottom: var(--space-4);
    right: var(--space-4);
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 90;
    transition: transform var(--transition-fast);
}
.whatsapp-float:hover { transform: scale(1.08); }

/* ----------------------------------------------------------------------------
   12. PAGINATION
   ---------------------------------------------------------------------------- */
.pagination { display: flex; justify-content: center; gap: var(--space-2); margin-top: var(--space-6); flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; border-radius: 50%;
    font-size: var(--fs-sm);
}
.pagination a { background: var(--color-bg-alt); }
.pagination a:hover { background: #e8e8ed; }
.pagination .is-current { background: var(--color-accent); color: #fff; }

/* ----------------------------------------------------------------------------
   13. FILTER SIDEBAR (product listing)
   ---------------------------------------------------------------------------- */
.filter-sidebar { margin-bottom: var(--space-5); }
.filter-group { margin-bottom: var(--space-4); }
.filter-group h4 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-2); }
.filter-group a {
    display: block; font-size: var(--fs-sm); color: var(--color-text-muted); padding: var(--space-1) 0;
}
.filter-group a.is-active, .filter-group a:hover { color: var(--color-accent); }

.listing-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }

/* ----------------------------------------------------------------------------
   13b. CART PAGE
   ---------------------------------------------------------------------------- */
.cart-line-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.cart-line-item-image { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-bg-alt); flex-shrink: 0; }
.cart-line-item-details { flex: 1; min-width: 140px; }
.cart-line-item-name { font-weight: 600; }
.cart-line-item-price { font-size: var(--fs-sm); color: var(--color-text-muted); }
.cart-line-item-qty { text-align: center; }
.cart-line-item-subtotal { font-weight: 700; min-width: 80px; text-align: right; }
.cart-summary { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) 0; margin-top: var(--space-3); border-top: 2px solid var(--color-border); }
.cart-summary-total { font-size: var(--fs-xl); font-weight: 700; }
.cart-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }

/* ----------------------------------------------------------------------------
   13c. SIZE / COLOR VARIANT PICKERS (product detail page)
   ---------------------------------------------------------------------------- */
.cart-line-item-variant { font-size: var(--fs-xs); color: var(--color-text-muted); margin: 2px 0; }

.size-options, .color-options { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.size-option {
    min-width: 44px;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white, #fff);
    color: var(--color-text);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.size-option:hover { border-color: var(--color-accent); }
.size-option.is-selected { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

.color-option {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-bg-alt);
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.color-option:hover { transform: scale(1.08); }
.color-option.is-selected { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3px var(--color-accent); }
.color-option-text {
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.8rem;
    font-size: var(--fs-xs);
    color: var(--color-text);
}

/* ----------------------------------------------------------------------------
   13d. CUSTOMER CONTACT MODAL (shown before an order goes to WhatsApp)
   ---------------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: var(--space-4);
}
.modal-overlay.is-visible { display: flex; }
.modal-box {
    background: var(--color-white, #fff);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-bottom: var(--space-2); }
.modal-actions { display: flex; gap: var(--space-3); margin-top: var(--space-4); }

/* ----------------------------------------------------------------------------
   14. EMPTY STATES & 404
   ---------------------------------------------------------------------------- */
.empty-state { text-align: center; padding: var(--space-7) var(--space-4); }
.empty-state h2 { font-size: var(--fs-xl); }

/* ----------------------------------------------------------------------------
   15. RESPONSIVE BREAKPOINTS (mobile-first: base styles above are for
       mobile; each breakpoint below progressively enhances for larger
       screens)
   ---------------------------------------------------------------------------- */

/* Small tablets and up */
@media (min-width: 640px) {
    .grid-sm-2 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablets and up */
@media (min-width: 768px) {
    .main-nav { display: block; }
    .mobile-menu-toggle { display: none; }
    .grid-md-3 { grid-template-columns: repeat(3, 1fr); }
    .product-detail { grid-template-columns: 1fr 1fr; }
    .listing-layout { grid-template-columns: 240px 1fr; }
    .hero-slide-content h2 { font-size: var(--fs-3xl); }
}

/* Desktops and up */
@media (min-width: 1024px) {
    .grid-lg-4 { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Reduced motion accessibility preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
