/* Web Artist Default Theme - Main Stylesheet */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-primary: #2563eb;
    --color-secondary: #1e40af;
    --color-accent: #f59e0b;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-bg: #ffffff;
    --color-bg-alt: #f9fafb;
    --color-border: #e5e7eb;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --radius-sm: 4px;
    --container-width: 1200px;
    --header-height: 80px;
    --transition: all 0.25s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    font-size: 15px;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-secondary); }

h1, h2, h3, h4, h5, h6 { line-height: 1.3; font-weight: 700; }

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    text-decoration: none;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-secondary); color: white; }
.btn-ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-bg-alt); }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { display: block; width: 100%; }

/* ===== Header (basic styles - enhanced in enhancements.css) ===== */
.site-header {
    background: white;
    box-shadow: 0 1px 3px var(--color-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Header top bar */
.header-top-bar {
    background: var(--color-primary);
    color: white;
    font-size: 0.8rem;
    padding: 6px 0;
}
.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-contact { display: flex; gap: 20px; }
.contact-item a { color: white; opacity: 0.9; }
.contact-item a:hover { opacity: 1; }
.header-social { display: flex; gap: 10px; }
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 0.85rem;
    text-decoration: none;
}
.social-icon:hover { background: rgba(255, 255, 255, 0.35); }

/* Header main */
.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}
.site-logo img { max-height: 48px; width: auto; }
.logo-icon { font-size: 2rem; color: var(--color-primary); }
.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
}

/* Header search */
.header-search {
    flex: 1;
    max-width: 500px;
    display: flex;
    position: relative;
}
.search-input {
    flex: 1;
    padding: 12px 48px 12px 18px;
    border: 2px solid var(--color-border);
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--color-bg-alt);
}
.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: white;
}
.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header actions */
.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* User account / login button */
.login-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.login-btn:hover {
    background: var(--color-secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.user-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 6px;
    background: var(--color-bg-alt);
    border: 2px solid var(--color-border);
    border-radius: 30px;
    text-decoration: none;
    color: var(--color-text);
    transition: var(--transition);
    white-space: nowrap;
}

.user-account-btn:hover {
    border-color: var(--color-primary);
    background: white;
}

.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.user-name-mini {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Cart wrapper */
.cart-wrapper { position: relative; }
.cart-icon-btn {
    position: relative;
    width: 48px;
    height: 48px;
    background: var(--color-bg-alt);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: var(--transition);
}
.cart-icon-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.cart-count-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: var(--color-accent);
    color: white;
    border-radius: 20px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Cart dropdown */
.cart-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--color-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
    overflow: hidden;
}
.cart-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.cart-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-primary);
    color: white;
}
.cart-dropdown-header h3 { font-size: 1.1rem; color: white; margin: 0; }
.cart-dropdown-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-dropdown-body {
    max-height: 350px;
    overflow-y: auto;
    padding: 8px 0;
}
.cart-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-light);
}
.cart-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.cart-empty-state p { margin-bottom: 16px; }
.cart-item-mini {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
}
.cart-item-mini-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--color-bg-alt);
    flex-shrink: 0;
}
.cart-item-mini-info { flex: 1; min-width: 0; }
.cart-item-mini-title {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}
.cart-item-mini-title a { color: var(--color-text); text-decoration: none; }
.cart-item-mini-title a:hover { color: var(--color-primary); }
.cart-item-mini-price {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 600;
}
.cart-item-mini-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.qty-control-mini {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}
.qty-btn-mini {
    width: 24px;
    height: 24px;
    background: var(--color-bg-alt);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-btn-mini:hover { background: var(--color-primary); color: white; }
.qty-display-mini {
    min-width: 28px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}
.cart-item-mini-remove {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}
.cart-dropdown-footer {
    padding: 16px 20px;
    border-top: 2px solid var(--color-border);
    background: var(--color-bg-alt);
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1rem;
}
.cart-total-row strong {
    color: var(--color-primary);
    font-size: 1.2rem;
    font-weight: 700;
}
.cart-actions { display: flex; gap: 8px; }
.cart-actions .btn { flex: 1; }

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
}
.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    border-right: 4px solid var(--color-success);
    pointer-events: auto;
}
.toast.toast-error { border-right-color: var(--color-danger); }
.toast.toast-warning { border-right-color: var(--color-accent); }
.toast.toast-info { border-right-color: var(--color-primary); }
.toast-icon { font-size: 1.5rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.toast-message { font-size: 0.85rem; color: var(--color-text-light); }

/* Main Menu */
.main-menu { 
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-alt);
}
.main-menu ul {
    list-style: none;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}
.main-menu li { position: relative; }
.main-menu a {
    display: block;
    padding: 12px 18px;
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 500;
}
.main-menu a:hover { background: var(--color-primary); color: white; }
.main-menu .has-dropdown > a::after { content: ' ▾'; font-size: 0.7em; }
.main-menu .dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 4px 12px var(--color-shadow);
    min-width: 200px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    display: none;
    z-index: 50;
}
.main-menu .has-dropdown:hover .dropdown { display: block; }
.main-menu .dropdown a { padding: 10px 16px; border-bottom: 1px solid var(--color-border); }
.main-menu .dropdown a:hover { background: var(--color-bg-alt); }
.main-menu .dropdown small { color: var(--color-text-light); }

/* Mobile menu open state */
@media (max-width: 768px) {
    .main-menu { display: none; }
    .main-menu.open { display: block; }
    .main-menu ul { flex-direction: column; }
    .main-menu .dropdown { position: static; box-shadow: none; }
}

/* ===== Hero Slider ===== */
.hero-slider {
    position: relative;
    overflow: hidden;
    background: var(--color-bg-alt);
    margin-bottom: 40px;
}
.slider-track { position: relative; height: 450px; }
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
    display: flex;
    align-items: center;
}
.slide.active { opacity: 1; }
.slide-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
/* HOTFIX 14 (Fix 3): The blue gradient overlay that previously sat on top of
   slider background images has been REMOVED so the background images are fully
   visible. To keep the white slide-title/subtitle text legible against any
   background (light or dark), we add a soft drop-shadow and a small dark
   gradient that sits BEHIND the text only (not over the whole image). */
.slide-content {
    position: relative;
    z-index: 2;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    color: white;
    width: 100%;
}
.slide-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    max-width: 600px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 2px rgba(0,0,0,0.8);
}
.slide-subtitle {
    font-size: 1.2rem;
    margin-bottom: 24px;
    max-width: 500px;
    opacity: 1;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
.slide-btn {
    background: white;
    color: var(--color-primary);
    padding: 12px 32px;
}
.slide-btn:hover { background: var(--color-accent); color: white; }

.slider-prev, .slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}
.slider-prev:hover, .slider-next:hover { background: white; }
.slider-prev { right: 20px; }
.slider-next { left: 20px; }

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.dot.active { background: white; width: 30px; border-radius: 5px; }

/* ===== Home Sections ===== */
.home-section { padding: 40px 0; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.section-title {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-icon { color: var(--color-accent); }
.section-link { font-size: 0.9rem; }

.section-discount { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); border-radius: var(--radius); padding: 40px 30px; margin: 40px 0; }
.section-featured { background: var(--color-bg-alt); border-radius: var(--radius); padding: 40px 30px; }

.empty-home { text-align: center; padding: 80px 20px; }
.empty-home h2 { font-size: 2rem; margin-bottom: 16px; color: var(--color-text-light); }

/* ===== Products Grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* HOTFIX 14 (Fix 6): Horizontal-scroll product carousels for the homepage.
   The same .product-card markup is reused; only the wrapper changes from a
   CSS grid to a horizontal flexbox with scroll-snap. Navigation buttons are
   rendered by main.js (carousel-nav) and let the user step through items. */
.product-carousel {
    position: relative;
    margin: 0 -8px;       /* allow first/last card to bleed into padding */
}
.product-carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 8px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) transparent;
}
.product-carousel-track::-webkit-scrollbar { height: 6px; }
.product-carousel-track::-webkit-scrollbar-track { background: transparent; }
.product-carousel-track::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
.product-carousel-track::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

.product-carousel-track > .product-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    margin: 0;
}
@media (max-width: 480px) {
    .product-carousel-track > .product-card { flex: 0 0 200px; }
}

.carousel-nav {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-text);
    transition: all 0.2s ease;
}
.carousel-nav:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.carousel-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.carousel-nav.carousel-prev { right: 4px; }
.carousel-nav.carousel-next { left: 4px; }
@media (max-width: 480px) {
    .carousel-nav { width: 32px; height: 32px; font-size: 1.2rem; }
}

/* HOTFIX 14 (Fix 4): Shop page filter sidebar styles. */
.filter-form { display: flex; flex-direction: column; gap: 4px; }
.filter-group { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.filter-group:last-of-type { border-bottom: none; }
.filter-group h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
}
.filter-checkbox-list {
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    padding-left: 4px;
    margin: 0;
}
.filter-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text);
}
.filter-checkbox-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.filter-checkbox-list small {
    color: var(--color-text-light);
    margin-inline-start: auto;
    font-size: 0.75rem;
}
.filter-price-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.filter-price-row input[type="text"],
.filter-price-row input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.filter-price-sep { color: var(--color-text-light); }
.filter-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
}
.filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.filter-actions .btn { flex: 1; }
.filter-active-summary {
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.8rem;
    margin-bottom: 12px;
    color: var(--color-text-light);
}
.filter-active-summary a {
    color: var(--color-danger);
    text-decoration: none;
    font-weight: 500;
    margin-inline-start: 4px;
}
.shop-toolbar-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}
.shop-toolbar-sort label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin: 0;
}
.shop-toolbar-sort select {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 0.85rem;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px var(--color-shadow);
    transition: var(--transition);
    border: 1px solid var(--color-border);
}
.product-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 10px 30px var(--color-shadow);
}
.product-image {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-bg-alt);
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.product-card:hover .product-image img { transform: scale(1.05); }
.product-badge-discount {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-danger);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}
.product-badge-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--color-accent);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
}
.product-info { padding: 14px; }
.product-category {
    display: inline-block;
    color: var(--color-text-light);
    font-size: 0.75rem;
    margin-bottom: 6px;
}
.product-title {
    font-size: 0.95rem;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
}
.product-title a { color: var(--color-text); }
.product-title a:hover { color: var(--color-primary); }
.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.price-old {
    color: var(--color-text-light);
    text-decoration: line-through;
    font-size: 0.85rem;
}
.price-current {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.05rem;
}

/* ===== Posts Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.post-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px var(--color-shadow);
    transition: var(--transition);
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px var(--color-shadow); }
.post-image {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--color-bg-alt);
}
.post-image img { width: 100%; height: 100%; object-fit: cover; }
.post-info { padding: 16px; }
.post-date {
    color: var(--color-text-light);
    font-size: 0.8rem;
    margin-bottom: 8px;
}
.post-info h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.4;
}
.post-info h3 a { color: var(--color-text); }
.post-info h3 a:hover { color: var(--color-primary); }
.post-info p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.6;
}
.read-more { font-size: 0.85rem; font-weight: 500; }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--color-text-light);
}
.breadcrumbs a { color: var(--color-text-light); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .sep { margin: 0 6px; opacity: 0.5; }

/* ===== Page Header Section ===== */
.page-header-section {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 30px;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
}
.page-header-section h1 { font-size: 2rem; margin-bottom: 8px; }
.page-header-section p { color: var(--color-text-light); }

/* ===== Single Post ===== */
.single-post { padding: 20px 0; }
.post-header { margin-bottom: 24px; }
.post-title { font-size: 2rem; margin-bottom: 12px; }
.post-meta {
    display: flex;
    gap: 20px;
    color: var(--color-text-light);
    font-size: 0.85rem;
}
.post-featured-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.post-content { 
    font-size: 1rem;
    line-height: 1.9;
}
.post-content p { margin-bottom: 16px; }
.post-content h2, .post-content h3 { margin: 24px 0 12px; }
.post-content img { border-radius: var(--radius-sm); margin: 16px 0; }
.post-content ul, .post-content ol { padding-right: 20px; margin-bottom: 16px; }

.post-footer {
    padding: 24px 0;
    border-top: 1px solid var(--color-border);
    margin-top: 24px;
}
.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.share-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: white !important;
}
.share-telegram { background: #0088cc; }
.share-whatsapp { background: #25d366; }
.share-twitter { background: #1da1f2; }

.related-posts { margin-top: 40px; }
.related-posts h2 { margin-bottom: 20px; font-size: 1.5rem; }

/* ===== Generic Page ===== */
.page-content { padding: 20px 0 40px; }
.page-title { font-size: 2rem; margin-bottom: 20px; }
.page-featured-image {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.page-body { 
    font-size: 1rem; 
    line-height: 1.9; 
}
.page-body p { margin-bottom: 16px; }

/* ===== Shop Layout ===== */
.shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    padding: 20px 0;
}
.shop-sidebar { position: sticky; top: 100px; align-self: start; }
.sidebar-widget {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.sidebar-widget h3 { font-size: 1.05rem; margin-bottom: 12px; }
.category-list { list-style: none; }
.category-list li { border-bottom: 1px solid var(--color-border); }
.category-list li:last-child { border-bottom: none; }
.category-list a {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: var(--color-text);
    font-size: 0.9rem;
}
.category-list a:hover, .category-list a.active { color: var(--color-primary); font-weight: 500; }
.category-list small { color: var(--color-text-light); }

.shop-main { min-width: 0; }
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
}
.results-count { font-size: 0.9rem; color: var(--color-text-light); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
}
.empty-state h3 { font-size: 1.3rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 20px; }

/* ===== Single Product ===== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 20px 0 40px;
}
.product-gallery { position: relative; }
.main-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px var(--color-shadow);
}
.no-image {
    aspect-ratio: 1;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: 1rem;
}
.product-discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--color-danger);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    font-size: 0.9rem;
}

.product-summary { padding: 0; }
.product-category-badge {
    display: inline-block;
    background: var(--color-bg-alt);
    color: var(--color-primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 12px;
}
.product-title { font-size: 1.75rem; margin-bottom: 12px; }
.product-excerpt {
    color: var(--color-text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.product-price-box {
    background: var(--color-bg-alt);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.product-price-box .price-current { font-size: 1.5rem; }
.product-price-box .price-old { font-size: 1rem; }

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.meta-item { display: flex; gap: 8px; font-size: 0.9rem; }
.meta-label { color: var(--color-text-light); min-width: 100px; }
.in-stock { color: var(--color-success); font-weight: 500; }
.out-of-stock { color: var(--color-danger); font-weight: 500; }

.quantity-selector {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: fit-content;
}
.qty-btn {
    background: var(--color-bg-alt);
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
}
.qty-btn:hover { background: var(--color-border); }
.qty-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-family: inherit;
}

.product-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}
.feature {
    padding: 8px 12px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text);
}

.product-description {
    margin-top: 40px;
    padding: 24px;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
}
.product-description h2 { margin-bottom: 16px; }
.description-content { line-height: 1.9; }
.description-content p { margin-bottom: 14px; }

.related-products { margin-top: 40px; }
.related-products h2 { margin-bottom: 20px; }

/* ===== Cart ===== */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    padding: 20px 0 40px;
}
.cart-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px var(--color-shadow);
    border-collapse: collapse;
}
.cart-table th {
    background: var(--color-bg-alt);
    padding: 12px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
}
.cart-table td {
    padding: 12px;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}
.cart-product {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cart-product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.btn-remove {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
}
.btn-remove:hover { opacity: 0.7; }
.cart-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.cart-summary {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 100px;
    align-self: start;
}
.cart-summary h3 { margin-bottom: 16px; }
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}
.summary-total {
    border-top: 2px solid var(--color-border);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.1rem;
    font-weight: 700;
}
.summary-total strong { color: var(--color-primary); }

/* ===== Checkout ===== */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    padding: 20px 0 40px;
}
.checkout-form { display: flex; flex-direction: column; gap: 24px; }
.form-section {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
}
.form-section h3 { margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--color-text);
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.required { color: var(--color-danger); }
.payment-methods { display: flex; flex-direction: column; gap: 8px; }
.payment-method {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.payment-method:hover { background: var(--color-bg-alt); }
.payment-method input { margin: 0; }

.checkout-summary {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 100px;
    align-self: start;
}
.checkout-summary h3 { margin-bottom: 16px; }
.cart-items-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}
.item-title small { color: var(--color-text-light); }
.item-price { color: var(--color-primary); font-weight: 500; }

.checkout-success {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    margin: 40px 0;
}
.success-icon { font-size: 4rem; margin-bottom: 20px; }
.checkout-success h1 { margin-bottom: 12px; color: var(--color-success); }
.checkout-success p { color: var(--color-text-light); margin-bottom: 24px; }
.order-summary, .order-items {
    text-align: right;
    margin: 24px auto;
    padding: 20px;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    max-width: 500px;
}
.order-summary h3, .order-items h3 { margin-bottom: 16px; }
.order-items ul { list-style: none; }
.order-items li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}
.error-code {
    font-size: 8rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 20px;
}
.error-404 h1 { font-size: 1.8rem; margin-bottom: 12px; }
.error-404 p { color: var(--color-text-light); margin-bottom: 24px; }
.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
}
.pagination a {
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.9rem;
}
.pagination a:hover, .pagination a.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ===== Footer ===== */
.site-footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 50px 0 20px;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}
.footer-about h3 { color: white; margin-bottom: 12px; font-size: 1.2rem; }
.footer-about p { margin-bottom: 12px; font-size: 0.9rem; }
.footer-contact { font-size: 0.85rem; }
.footer-contact a { color: #d1d5db; }
.footer-contact a:hover { color: white; }
.footer-col h4 {
    color: white;
    margin-bottom: 14px;
    font-size: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
    color: #d1d5db;
    font-size: 0.9rem;
}
.footer-col a:hover { color: white; }
.social-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
    overflow: hidden;
}
.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}
.social-link img {
    width: 24px;
    height: 24px;
    display: block;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
}
.powered-by { margin-top: 8px; color: #6b7280; }
.powered-by a { color: #9ca3af; }

/* Back to top */
#back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { background: var(--color-secondary); }

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .shop-layout, .cart-layout, .checkout-layout, .product-detail {
        grid-template-columns: 1fr;
    }
    .shop-sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .slider-track { height: 350px; }
    .slide-title { font-size: 2rem; }
}

@media (max-width: 768px) {
    .header-top-bar { display: none; }
    .header-main { flex-wrap: wrap; gap: 12px; }
    .header-search { order: 3; width: 100%; max-width: none; }
    .mobile-menu-toggle { display: flex; }
    .main-menu { display: none; }
    .main-menu.open { display: block; }
    .main-menu ul { flex-direction: column; }
    .main-menu .dropdown { position: static; box-shadow: none; }
    .cart-dropdown {
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        width: auto;
    }
    .toast-container { left: 10px; right: 10px; }
    .toast { min-width: 0; width: 100%; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .posts-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .slider-track { height: 250px; }
    .slide-title { font-size: 1.5rem; }
    .slide-subtitle { font-size: 1rem; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .cart-table { font-size: 0.8rem; }
    .cart-table th, .cart-table td { padding: 8px; }
    .cart-product img { width: 40px; height: 40px; }
    .error-code { font-size: 5rem; }
    .home-section { padding: 24px 0; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .container { padding: 0 12px; }
}

/* ============================================================
 * HOTFIX v4.6: Sticky add-to-cart bar for product pages.
 * This was missing from the original stylesheet — the HTML was
 * being rendered but no CSS rules existed, so the bar was invisible.
 * ============================================================ */
.product-sticky-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border-top: 2px solid var(--color-primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    /* HOTFIX v4.8: Always visible — removed transform/transition */
    padding: 12px 0;
}
/* HOTFIX v4.8: .visible class no longer needed — bar is always shown */
.sticky-cart-inner {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.sticky-cart-product {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.sticky-cart-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.sticky-cart-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.sticky-cart-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sticky-cart-prices {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sticky-cart-price-old {
    text-decoration: line-through;
    color: var(--color-text-light);
    font-size: 0.85rem;
}
.sticky-cart-price-new,
.sticky-cart-price-current {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.05rem;
}
.sticky-cart-discount-badge {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.sticky-cart-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.sticky-cart-qty-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
}
.sticky-cart-qty-display {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
    min-width: 24px;
    text-align: center;
}
.sticky-cart-submit {
    white-space: nowrap;
}

/* Add bottom padding to body so the sticky bar doesn't cover content */
body.has-sticky-cart {
    padding-bottom: 90px;
}

@media (max-width: 768px) {
    .sticky-cart-inner {
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 12px;
    }
    .sticky-cart-thumb {
        width: 40px;
        height: 40px;
    }
    .sticky-cart-title {
        font-size: 0.85rem;
    }
    .sticky-cart-price-new,
    .sticky-cart-price-current {
        font-size: 0.95rem;
    }
    .sticky-cart-submit {
        width: 100%;
        padding: 10px;
    }
    body.has-sticky-cart {
        padding-bottom: 140px;
    }
}

/* ============================================================
 * HOTFIX v4.7: Options picker error + animation
 * ============================================================ */
.options-picker-error {
    display: none;
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes pulse-error {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); }
}

.option-group {
    transition: animation 0.3s;
}

/* Options picker improvements */
.product-options-picker {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}
.options-picker-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--color-text);
}
.options-picker-hint {
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.option-group {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}
.option-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.option-group-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.option-required-badge {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.option-optional-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.option-values-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.option-value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.option-value-row:last-child {
    border-bottom: none;
}
.option-value-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.option-value-name {
    font-size: 0.9rem;
}
.option-value-modifier {
    font-size: 0.75rem;
    color: var(--color-text-light);
}
.option-value-qty {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}
.options-picker-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: #ecfdf5;
    border-radius: 8px;
    font-size: 0.9rem;
}
.options-picker-summary strong {
    color: #059669;
    font-size: 1.1rem;
}
