
:root {
    --blue: #3B82F6;
    --orange: #F97316;
    --bg-dark: #0a1630;
    --surface-dark: #1a2942;
    --line-dark: #334760;
    --text-dark: #f0f4fb;
    --muted-dark: #98a7be;
}

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

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

.gradient-text {
    background: linear-gradient(90deg, var(--blue), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--blue), var(--orange));
}

body.dark {
    background: radial-gradient(circle at 20% -20%, #1e3760, transparent 45%), var(--bg-dark);
    color: var(--text-dark);
}

body.dark header {
    background: rgba(17, 29, 52, 0.82) !important;
    border-bottom: 1px solid rgba(78, 98, 130, 0.4);
    backdrop-filter: blur(8px);
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.trust-item {
    border: 1px solid #dbe3ef;
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

body.dark .trust-item {
    background: var(--surface-dark);
    color: var(--text-dark);
    border-color: var(--line-dark);
}

.hero-banner {
    border-radius: 16px;
    background: linear-gradient(140deg, rgba(59,130,246,0.17), rgba(249,115,22,0.2));
    border: 1px solid #d8e3f6;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
}

body.dark .hero-banner {
    background: linear-gradient(140deg, rgba(59,130,246,0.18), rgba(249,115,22,0.16));
    border-color: var(--line-dark);
}

.hero-kicker {
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #1d4ed8;
    font-weight: 700;
    margin-bottom: 6px;
}

body.dark .hero-kicker {
    color: #8fb6ff;
}

.hero-banner h2 {
    font-size: 26px;
    line-height: 1.25;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

body.dark .hero-banner h2 {
    color: var(--text-dark);
}

.hero-banner p {
    font-size: 14px;
    color: #475569;
}

body.dark .hero-banner p {
    color: var(--muted-dark);
}

.hero-cta {
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--orange));
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.controls-shell {
    display: grid;
    grid-template-columns: 1fr 220px 150px;
    gap: 12px;
    align-items: end;
}

.sort-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sort-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 600;
    padding-left: 6px;
}

body.dark .sort-label {
    color: var(--muted-dark);
}

.sort-select,
.favorite-toggle-btn {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 999px;
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.favorite-toggle-btn {
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #334155;
}

.favorite-toggle-btn.active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #f97316);
}

body.dark #search-bar,
body.dark .sort-select,
body.dark .favorite-toggle-btn {
    background: var(--surface-dark);
    border-color: var(--line-dark);
    color: var(--text-dark);
}

body.dark #search-bar::placeholder {
    color: var(--muted-dark);
}

.category-tab {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.category-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

body.dark .category-tab:not(.gradient-bg) {
    background-color: var(--surface-dark);
    color: var(--text-dark);
    border-color: var(--line-dark);
}

.subcategory-tab {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark .subcategory-tab {
    background: var(--surface-dark);
    color: var(--text-dark);
    border-color: var(--line-dark);
}

.subcategory-tab.active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--blue), var(--orange));
    color: #fff;
}

.quick-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.marketplace-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.marketplace-btn {
    border: 1px solid #d3dced;
    border-radius: 999px;
    padding: 7px 12px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.marketplace-btn.active {
    background: linear-gradient(135deg, var(--blue), var(--orange));
    border-color: transparent;
    color: #fff;
}

body.dark .marketplace-btn {
    background: var(--surface-dark);
    border-color: var(--line-dark);
    color: var(--text-dark);
}

body.dark .marketplace-btn.active {
    border-color: transparent;
}

.quick-filter-btn {
    border: 1px solid #cfd9ea;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-filter-btn.active {
    background: linear-gradient(135deg, var(--blue), var(--orange));
    border-color: transparent;
    color: #fff;
}

body.dark .quick-filter-btn {
    background: var(--surface-dark);
    color: var(--text-dark);
    border-color: var(--line-dark);
}

body.dark .quick-filter-btn.active {
    border-color: transparent;
}

.status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.status-item {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 7px;
}

body.dark .status-item {
    background: var(--surface-dark);
    color: var(--text-dark);
    border-color: var(--line-dark);
}

.featured-shell {
    border: 1px solid #dbe4f3;
    background: #fff;
    border-radius: 14px;
    padding: 14px;
}

body.dark .featured-shell {
    background: #111f38;
    border-color: var(--line-dark);
}

.featured-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.featured-head h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-head span {
    font-size: 12px;
    color: #64748b;
}

body.dark .featured-head h3 {
    color: var(--text-dark);
}

body.dark .featured-head span {
    color: var(--muted-dark);
}

.featured-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.featured-card {
    min-width: 210px;
    max-width: 210px;
    border: 1px solid #dbe5f2;
    border-radius: 12px;
    padding: 8px;
    background: #fff;
    cursor: pointer;
}

.featured-card img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    border-radius: 8px;
    background: #f2f5fb;
}

.featured-title {
    font-size: 12px;
    margin-top: 7px;
    color: #334155;
    line-height: 1.35;
    min-height: 34px;
}

.featured-price {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #059669;
}

body.dark .featured-card {
    background: var(--surface-dark);
    border-color: var(--line-dark);
}

body.dark .featured-card img {
    background: #0d1a30;
}

body.dark .featured-title {
    color: var(--text-dark);
}

.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

body.dark .product-card {
    border-color: var(--line-dark);
    background-color: #101f38;
    box-shadow: 0 8px 16px rgba(3, 8, 18, 0.5);
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-image-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f3f4f6;
}

body.dark .product-image-wrapper {
    background: #0e1a30;
}

.product-image {
    transition: transform 0.4s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.brand-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    color: white;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #F97316, #EA580C);
    color: white;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
    z-index: 10;
}

.marketplace-chip {
    position: absolute;
    left: 8px;
    bottom: 8px;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    z-index: 10;
}

.gallery-count-badge {
    position: absolute;
    right: 42px;
    bottom: 8px;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.favorite-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    cursor: pointer;
    z-index: 11;
}

.favorite-btn.active {
    background: #ef4444;
    color: #fff;
}

body.dark .favorite-btn {
    background: rgba(31, 49, 77, 0.9);
    color: #d8e4f8;
}

.product-card .p-5 {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

.deal-timestamp {
    font-size: 10px;
    font-weight: 500;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark .deal-timestamp {
    color: var(--muted-dark);
}

.product-card h4 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #1F2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px;
    margin: 0;
}

body.dark .product-card h4 {
    color: var(--text-dark);
}

.product-card .mt-auto {
    margin-top: auto;
    padding-top: 8px;
}

.product-card .text-xl {
    font-size: 16px;
    font-weight: 700;
    color: #059669;
}

body.dark .product-card .text-xl {
    color: #38d29f;
}

.card-btn {
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    color: #fff;
}

.live-indicator {
    width: 10px;
    height: 10px;
    background-color: #EF4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.telegram-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #38a1f3, #0088cc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
}

.telegram-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.5);
}

.scroll-top-btn {
    position: fixed;
    right: 20px;
    bottom: 88px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--blue), var(--orange));
    color: #fff;
    cursor: pointer;
    display: none;
    z-index: 1000;
}

.scroll-top-btn.show {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.deal-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
}

.deal-modal.show {
    display: block;
}

.deal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 20, 0.72);
}

.deal-modal-content {
    position: relative;
    width: min(940px, calc(100vw - 30px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: 20px auto;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #dbe5f2;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
}

body.dark .deal-modal-content {
    background: #101f38;
    border-color: var(--line-dark);
}

.modal-close-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}

.modal-image-wrap {
    position: relative;
    background: #f4f6fb;
    min-height: 320px;
}

body.dark .modal-image-wrap {
    background: #0b162b;
}

.modal-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
}

.modal-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    cursor: pointer;
    z-index: 12;
    display: none;
}

.modal-image-nav.prev {
    left: 10px;
}

.modal-image-nav.next {
    right: 10px;
}

.modal-image-nav.show {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-image-dots {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: none;
    gap: 6px;
    z-index: 12;
}

.modal-image-dots.show {
    display: flex;
}

.modal-image-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.modal-image-dots button.active {
    background: #ffffff;
}

.modal-details {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    font-size: 11px;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
    font-weight: 600;
}

body.dark .pill {
    background: rgba(59, 130, 246, 0.2);
    color: #9ec3ff;
}

.modal-title {
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
    color: #0f172a;
}

body.dark .modal-title {
    color: var(--text-dark);
}

.modal-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-price {
    font-size: 26px;
    color: #10b981;
    font-weight: 700;
}

.modal-discount {
    font-size: 12px;
    border-radius: 999px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #F97316, #EA580C);
    color: #fff;
    font-weight: 700;
}

.modal-description {
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    background: #f6f8fc;
    border: 1px solid #dbe5f2;
    border-radius: 10px;
    padding: 10px;
    max-height: 170px;
    overflow-y: auto;
}

body.dark .modal-description {
    color: #d4dfef;
    background: #0d1b32;
    border-color: var(--line-dark);
}

.modal-tracking {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 12px;
}

body.dark .modal-tracking {
    color: var(--muted-dark);
}

.modal-similar-shell h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

body.dark .modal-similar-shell h4 {
    color: var(--muted-dark);
}

.modal-similar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.modal-similar-item {
    border: 1px solid #d6e0f0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    background: #fff;
}

.modal-similar-item img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: contain;
    background: #f2f5fb;
}

.modal-similar-item strong {
    font-size: 12px;
    color: #0f172a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-similar-item span {
    font-size: 12px;
    color: #059669;
    font-weight: 700;
}

body.dark .modal-similar-item {
    background: #122540;
    border-color: var(--line-dark);
}

body.dark .modal-similar-item img {
    background: #091226;
}

body.dark .modal-similar-item strong {
    color: var(--text-dark);
}

.modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-actions a,
.modal-secondary-btn {
    border-radius: 8px;
    border: none;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.modal-secondary-btn {
    background: #e2e8f0;
    color: #1f2937;
}

body.dark .modal-secondary-btn {
    background: #1f314d;
    color: #d8e4f8;
    border: 1px solid var(--line-dark);
}

#deals-container {
    gap: 12px;
}

.load-more-shell {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.load-more-btn {
    border: 1px solid #cfd9ea;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #1e3a8a;
    background: #fff;
    cursor: pointer;
}

.load-more-btn:hover {
    border-color: #7aa6e8;
}

.load-more-btn.hidden {
    display: none;
}

body.dark .load-more-btn {
    background: var(--surface-dark);
    border-color: var(--line-dark);
    color: #9fc0ff;
}

.empty-state {
    color: #9ca3af;
    text-align: center;
    grid-column: 1 / -1;
    padding: 24px;
}

.skeleton-card {
    height: 250px;
    border-radius: 12px;
    border: 1px solid #dbe4f0;
    background: linear-gradient(90deg, #eef2f9 25%, #f8faff 50%, #eef2f9 75%);
    background-size: 300% 100%;
    animation: shimmer 1.3s infinite;
}

body.dark .skeleton-card {
    border-color: var(--line-dark);
    background: linear-gradient(90deg, #1b2a45 25%, #253753 50%, #1b2a45 75%);
    background-size: 300% 100%;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.toast-container {
    position: fixed;
    top: 78px;
    right: 18px;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 220px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.toast.info { background: #2563eb; }
.toast.success { background: #059669; }
.toast.warn { background: #d97706; }

.product-page-body {
    min-height: 100vh;
    background: radial-gradient(circle at 15% -20%, rgba(59, 130, 246, 0.2), transparent 45%), #f4f7fd;
    color: #0f172a;
}

.product-page-shell {
    width: min(1080px, calc(100vw - 24px));
    margin: 24px auto;
}

.back-home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 14px;
}

.product-detail-card {
    border-radius: 16px;
    border: 1px solid #dbe5f3;
    background: #fff;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
}

.product-detail-image-wrap {
    min-height: 360px;
    background: #eef3fb;
}

.product-detail-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.product-detail-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-detail-content h1 {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-row strong {
    font-size: 30px;
    color: #059669;
}

.price-row span {
    font-size: 13px;
    border-radius: 999px;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--blue), var(--orange));
    color: #fff;
    font-weight: 700;
}

.product-detail-content pre {
    white-space: pre-wrap;
    border: 1px solid #d7e4f7;
    border-radius: 10px;
    background: #f7fafe;
    color: #334155;
    padding: 12px;
    max-height: 260px;
    overflow-y: auto;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #64748b;
    font-size: 13px;
}

.buy-now-link {
    align-self: flex-start;
    text-decoration: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--orange));
}

body.dark .product-page-body {
    background: radial-gradient(circle at 20% -20%, #1e3760, transparent 45%), var(--bg-dark);
    color: var(--text-dark);
}

body.dark .product-detail-card {
    background: #101f38;
    border-color: var(--line-dark);
}

body.dark .product-detail-image-wrap {
    background: #081325;
}

body.dark .back-home-link {
    color: #9ec3ff;
}

body.dark .product-detail-content h1 {
    color: var(--text-dark);
}

body.dark .product-detail-content pre {
    background: #0d1b32;
    color: #d4dfef;
    border-color: var(--line-dark);
}

body.dark .detail-meta {
    color: var(--muted-dark);
}

@media (max-width: 980px) {
    .controls-shell {
        grid-template-columns: 1fr;
    }

    .hero-banner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 880px) {
    .deal-modal-content {
        grid-template-columns: 1fr;
    }

    .modal-image-wrap {
        min-height: 240px;
    }

    .modal-similar {
        grid-template-columns: 1fr;
    }

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

    .product-detail-image-wrap {
        min-height: 280px;
    }

    .product-detail-content h1 {
        font-size: 24px;
    }

    .price-row strong {
        font-size: 24px;
    }
}

@media (min-width: 768px) {
    #deals-container {
        gap: 20px;
    }

    .product-image-wrapper {
        aspect-ratio: 4 / 3;
    }

    .product-card .p-5 {
        padding: 16px;
        gap: 10px;
    }

    .product-card h4 {
        font-size: 15px;
        min-height: 42px;
    }

    .product-card .text-xl {
        font-size: 18px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
    }

    #deals-container {
        gap: 24px;
    }

    .product-image-wrapper {
        aspect-ratio: 1 / 1;
    }
}

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

html {
    scroll-behavior: smooth;
}

* {
    transition-property: background-color, border-color, color;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

/* ===== Site Footer ===== */
.site-footer {
    margin-top: 56px;
    border-top: 1px solid #dbe3ef;
    background: #ffffff;
    padding: 40px 0 0;
}

body.dark .site-footer {
    background: rgba(13, 23, 43, 0.85);
    border-top-color: var(--line-dark);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 28px;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
    }
}

.footer-brand {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-tagline {
    font-size: 0.82rem;
    line-height: 1.6;
    color: #64748b;
    max-width: 320px;
}

body.dark .footer-tagline {
    color: var(--muted-dark);
}

.footer-social {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--orange));
    transition: transform 0.15s ease;
}

.footer-social a:hover {
    transform: translateY(-2px);
}

.site-footer h3 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #334155;
    margin-bottom: 12px;
}

body.dark .site-footer h3 {
    color: var(--text-dark);
}

.site-footer ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer ul a {
    font-size: 0.85rem;
    color: #64748b;
    text-decoration: none;
}

.site-footer ul a:hover {
    color: var(--blue);
}

body.dark .site-footer ul a {
    color: var(--muted-dark);
}

body.dark .site-footer ul a:hover {
    color: #93c5fd;
}

.footer-bottom {
    border-top: 1px solid #e5ecf6;
    padding: 16px 0 18px;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
}

body.dark .footer-bottom {
    border-top-color: var(--line-dark);
}

/* ===== Hero Deals Slider ===== */
.hero-slider {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 430px;
    background:
        radial-gradient(700px 300px at 85% -10%, rgba(249, 115, 22, 0.16), transparent 60%),
        radial-gradient(700px 340px at -10% 110%, rgba(59, 130, 246, 0.22), transparent 60%),
        linear-gradient(150deg, #16264a 0%, #0d1830 100%);
    border: 1px solid rgba(96, 130, 182, 0.35);
    box-shadow: 0 22px 44px -18px rgba(4, 12, 30, 0.55);
}

body:not(.dark) .hero-slider {
    background:
        radial-gradient(700px 300px at 85% -10%, rgba(249, 115, 22, 0.12), transparent 60%),
        radial-gradient(700px 340px at -10% 110%, rgba(59, 130, 246, 0.14), transparent 60%),
        linear-gradient(150deg, #ffffff 0%, #eef3fb 100%);
    border-color: #d8e3f6;
    box-shadow: 0 18px 38px -20px rgba(30, 64, 120, 0.25);
}

.hero-track {
    position: absolute;
    inset: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.55s ease, visibility 0.55s ease;
    cursor: pointer;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.hero-media {
    position: relative;
    flex: 1 1 55%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 18px 6px;
}

.hero-media img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 14px 30px -14px rgba(2, 8, 20, 0.5);
    transform: scale(0.96);
    transition: transform 0.6s ease;
}

.hero-slide.active .hero-media img {
    transform: scale(1);
}

.hero-discount {
    position: absolute;
    top: 26px;
    left: 26px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: 0 8px 18px -6px rgba(239, 68, 68, 0.55);
    letter-spacing: 0.02em;
}

.hero-fresh {
    position: absolute;
    top: 26px;
    right: 26px;
    background: rgba(16, 185, 129, 0.92);
    color: #fff;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 5px 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hero-content {
    flex: 0 0 auto;
    padding: 10px 20px 52px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-pill {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(96, 150, 220, 0.45);
    color: #9cc3f5;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 4px 10px;
    border-radius: 999px;
}

body:not(.dark) .hero-pill {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.3);
}

.hero-store {
    font-size: 0.72rem;
    font-weight: 600;
    color: #f8b078;
}

.hero-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: #f0f4fb;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body:not(.dark) .hero-title {
    color: #1e293b;
}

.hero-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.hero-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ade80;
}

body:not(.dark) .hero-price {
    color: #059669;
}

.hero-mrp {
    font-size: 0.9rem;
    color: #8fa1bd;
    text-decoration: line-through;
}

.hero-cta-btn {
    margin-top: 4px;
    align-self: flex-start;
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 22px -8px rgba(249, 115, 22, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -8px rgba(249, 115, 22, 0.65);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(148, 178, 220, 0.35);
    background: rgba(10, 20, 40, 0.55);
    backdrop-filter: blur(6px);
    color: #e2ebf7;
    font-size: 0.95rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.hero-arrow:hover {
    background: rgba(59, 130, 246, 0.65);
    transform: translateY(-50%) scale(1.06);
}

.hero-arrow.prev { left: 14px; }
.hero-arrow.next { right: 14px; }

.hero-dots {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 7px;
}

.hero-dots button {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    background: rgba(148, 178, 220, 0.45);
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease;
}

.hero-dots button.active {
    width: 24px;
    background: linear-gradient(90deg, #3B82F6, #F97316);
}

@media (min-width: 768px) {
    .hero-slider {
        height: 400px;
    }

    .hero-slide {
        flex-direction: row-reverse;
        align-items: stretch;
    }

    .hero-media {
        flex: 0 0 44%;
        padding: 26px;
    }

    .hero-content {
        flex: 1;
        justify-content: center;
        padding: 30px 20px 30px 46px;
        gap: 12px;
    }

    .hero-title {
        font-size: 1.65rem;
        -webkit-line-clamp: 3;
    }

    .hero-price {
        font-size: 2.1rem;
    }

    .hero-mrp {
        font-size: 1.05rem;
    }

    .hero-cta-btn {
        font-size: 0.95rem;
        padding: 12px 28px;
    }

    .hero-arrow {
        display: inline-flex;
    }

    .hero-discount {
        top: 34px;
        left: auto;
        right: 34px;
    }

    .hero-fresh {
        top: 34px;
        right: auto;
        left: 34px;
    }
}

/* ===== Card image auto-gallery ===== */
.card-gallery-img {
    opacity: 0;
    transition: opacity 0.55s ease, transform 0.4s ease;
}

.card-gallery-img.active {
    opacity: 1;
}

.card-buy-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== SEO About Section ===== */
.seo-about {
    padding: 34px 0 10px;
}

.seo-about h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 10px;
}

body.dark .seo-about h2 {
    color: var(--text-dark);
}

.seo-about p {
    font-size: 0.82rem;
    line-height: 1.7;
    color: #64748b;
    max-width: 900px;
}

body.dark .seo-about p {
    color: var(--muted-dark);
}

/* ===== Breadcrumbs (category + product pages) ===== */
.cat-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #8fa1bd;
    margin-bottom: 18px;
}

.cat-breadcrumb a {
    color: #6ea8f0;
    text-decoration: none;
}

.cat-breadcrumb a:hover {
    text-decoration: underline;
}

.cat-breadcrumb strong {
    color: #d7e1f2;
    font-weight: 600;
}

body:not(.dark) .cat-breadcrumb strong {
    color: #334155;
}

/* ===== Category Landing Page ===== */
.cat-page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 16px 40px;
}

.cat-head h1 {
    font-size: 1.55rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--blue), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.cat-head p {
    font-size: 0.88rem;
    color: #98a7be;
    line-height: 1.65;
    max-width: 760px;
    margin-bottom: 24px;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 34px;
}

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

@media (min-width: 1024px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}

.cat-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-dark);
    border: 1px solid var(--line-dark);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px -12px rgba(2, 8, 20, 0.55);
}

.cat-card-img {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: #fff;
}

.cat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.cat-discount {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}

.cat-card-title {
    padding: 10px 12px 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card-price {
    padding: 0 12px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #4ade80;
}

.cat-card-price del {
    font-size: 0.72rem;
    font-weight: 400;
    color: #7d8ca3;
    margin-left: 6px;
}

.cat-more h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.cat-chip {
    border: 1px solid var(--line-dark);
    background: var(--surface-dark);
    color: var(--text-dark);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.cat-chip:hover {
    background: linear-gradient(135deg, var(--blue), var(--orange));
    border-color: transparent;
    color: #fff;
}

.cat-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--line-dark);
    padding-top: 18px;
    font-size: 0.8rem;
    color: #8fa1bd;
}

.cat-footer a {
    color: #6ea8f0;
    text-decoration: none;
}

.cat-footer a:hover {
    text-decoration: underline;
}

/* ===== Related Products (product page) ===== */
.related-shell {
    margin-top: 34px;
}

.related-shell h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

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

@media (min-width: 1024px) {
    .related-grid { grid-template-columns: repeat(6, 1fr); }
}

.related-card {
    background: var(--surface-dark);
    border: 1px solid var(--line-dark);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease;
}

.related-card:hover {
    transform: translateY(-3px);
}

.related-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    padding: 6px;
}

.related-title {
    padding: 8px 10px 2px;
    font-size: 0.72rem;
    color: var(--text-dark);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-price {
    padding: 0 10px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #4ade80;
}

.related-more-link {
    display: inline-block;
    color: #6ea8f0;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.related-more-link:hover {
    text-decoration: underline;
}

/* ===== Hero loading skeleton (CLS fix) ===== */
.hero-loading .hero-arrow,
.hero-loading .hero-dots {
    display: none !important;
}

.hero-loading .hero-track::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(120, 150, 200, 0.09) 50%, transparent 70%);
    background-size: 220% 100%;
    animation: heroShimmer 1.4s linear infinite;
}

@keyframes heroShimmer {
    from { background-position: 130% 0; }
    to { background-position: -90% 0; }
}

/* ===== Hero dots: bigger touch targets (a11y) ===== */
.hero-dots {
    gap: 2px;
}

.hero-dots button {
    width: 26px;
    height: 26px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
}

.hero-dots button span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 178, 220, 0.45);
    transition: all 0.25s ease;
}

.hero-dots button.active {
    width: 40px;
}

.hero-dots button.active span {
    width: 26px;
    background: linear-gradient(90deg, #3B82F6, #F97316);
}
