/* ============================================================
   TOOLS LAB – UNIFIED MASTER DESIGN SYSTEM & STYLES (styles.css)
   ============================================================ */

/* ---------- CSS RESET & BOX MODEL ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Theme Colors */
    --primary: #6C3CE1;
    --primary-dark: #5228b5;
    --primary-light: #8b6bf0;
    --primary-bg: #f4efff;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --whatsapp-green: #25D366;
    --whatsapp-dark: #128C7E;

    /* Semantic Feedback Colors */
    --success: #10b981;
    --success-dark: #059669;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --warning-bg: #fffbeb;
    --info: #3b82f6;
    --info-dark: #2563eb;
    --info-bg: #eff6ff;

    /* Neutral Monochrome Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Shadows & Border Radii */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.12);
    --shadow-premium: 0 20px 45px -10px rgba(108, 60, 225, 0.18);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    /* Smooth Micro-Transitions */
    --transition: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    transition: var(--transition-fast);
}

input, select, textarea {
    font-family: inherit;
    outline: none;
}

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

/* Containers & Common Utilities */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }

/* ---------- BUTTON DESIGN SYSTEM ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(108, 60, 225, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: var(--success-dark);
}

.btn-whatsapp {
    background: var(--whatsapp-green);
    color: #fff;
}
.btn-whatsapp:hover {
    background: var(--whatsapp-dark);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.84rem;
}
.btn-xs {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: 6px;
}
.btn-block {
    width: 100%;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ---------- BADGES & TAGS ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
    line-height: 1.25;
}
.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-success { background: var(--success-bg); color: var(--success-dark); }
.tag-danger { background: var(--danger-bg); color: var(--danger-dark); }
.tag-warning { background: var(--warning-bg); color: var(--warning-dark); }
.tag-info { background: var(--info-bg); color: var(--info-dark); }
.tag-purple { background: #f3e8ff; color: #7e22ce; }
.tag-awaiting { background: #fef3c7; color: #b45309; }
.tag-rejected { background: #fee2e2; color: #b91c1c; }
.tag-expiring { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; font-weight: 700; }
.tag-expired { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; font-weight: 700; }
.tag-lifetime { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; font-weight: 700; }

/* ---------- FORM CONTROLS ---------- */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--gray-900);
    background: #fff;
    transition: var(--transition-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.12);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}
.form-hint {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 4px;
}
.error-msg {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 6px;
    min-height: 18px;
}

/* Password Input Visibility Toggle */
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.password-input-wrap input {
    width: 100%;
    padding-right: 44px !important;
}
.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--gray-500);
    padding: 6px 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    z-index: 2;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}
.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
    color: var(--primary);
    background-color: rgba(108, 60, 225, 0.08);
    outline: none;
}


/* ---------- MODAL SYSTEM ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-card-lg {
    max-width: 780px;
}
.modal-card-xl {
    max-width: 960px;
}
.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}
.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: var(--gray-100);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition-fast);
}
.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* ============================================================
   CLIENT STOREFRONT STYLES
   ============================================================ */

/* Store Header */
.store-header {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 14px 0;
    transform: translateZ(0);
    will-change: transform;
}
.store-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.store-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    cursor: pointer;
}
.store-logo i {
    font-size: 1.5rem;
}
.store-logo span {
    color: var(--gray-900);
}

.store-search-wrap {
    flex: 1;
    max-width: 440px;
    position: relative;
}
.store-search-input {
    width: 100%;
    padding: 9px 40px 9px 16px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--gray-300);
    font-size: 0.9rem;
    background: var(--gray-50);
    transition: var(--transition-fast);
}
.store-search-input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.1);
}
.store-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: var(--gray-400);
    font-size: 0.95rem;
}
.store-search-btn:hover {
    color: var(--primary);
}

.store-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-100);
    padding: 4px 12px 4px 6px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
}
.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}
.admin-badge-link {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.28);
}
.admin-badge-link:hover {
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

/* Hero Section */
.hero-banner {
    background: linear-gradient(180deg, #f4efff 0%, #ffffff 100%);
    padding: 56px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--primary-light);
    color: var(--primary);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.hero-title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 12px;
}
.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--gray-600);
    max-width: 640px;
    margin: 0 auto 28px;
}
.hero-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}
.hero-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-700);
}
.hero-feature-item i {
    color: var(--success);
    font-size: 1.05rem;
}

/* Category Filter Bar */
.category-bar {
    padding: 24px 0 16px;
}
.category-list {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.category-list::-webkit-scrollbar {
    height: 4px;
}
.category-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}
.cat-pill {
    padding: 8px 18px;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
    transition: var(--transition-fast);
}
.cat-pill:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}
.cat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 60, 225, 0.25);
}

/* Product Catalog Grid */
.product-section {
    padding: 20px 0 80px;
}
.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.catalog-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
}
.catalog-count {
    font-size: 0.88rem;
    color: var(--gray-500);
}

.product-grid {
    display: flex;
    flex-direction: column;
    gap: 36px;
    width: 100%;
}

/* ============================================================
   CATEGORY-WISE STOREFRONT PRODUCT ROWS
   ============================================================ */
.category-row-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

.category-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.category-row-title-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.category-row-indicator {
    width: 4px;
    height: 22px;
    background: var(--primary);
    border-radius: var(--radius-full);
    display: inline-block;
    flex-shrink: 0;
}

.category-row-title {
    font-size: 1.32rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.2;
}

.category-row-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(108, 60, 225, 0.15);
}

.category-row-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-row-see-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-decoration: none;
}

.category-row-see-all:hover {
    color: var(--primary-dark);
    background: var(--primary-bg);
    transform: translateX(2px);
}

.category-row-nav-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s ease;
}

.cat-nav-btn:hover:not(:disabled) {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

.cat-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: var(--gray-50);
}

/* ============================================================
   RESPONSIVE WRAPPING CATEGORY GRID & COMPACT PRODUCT CARDS (TASK 2)
   ============================================================ */

/* Category Wrapping Grid */
.category-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Wide desktop (>1100px): 4 columns */
@media (min-width: 1101px) {
    .category-products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }
}

/* Smaller desktops / laptops (861px - 1100px): 3 columns */
@media (max-width: 1100px) and (min-width: 861px) {
    .category-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

/* Tablets and medium screens (641px - 860px): 2 columns */
@media (max-width: 860px) and (min-width: 641px) {
    .category-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    .category-row-title {
        font-size: 1.15rem;
    }
}

/* Toolsmandu-Inspired Compact Product Card */
.category-products-grid .product-card,
.product-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    contain: content;
}

.category-products-grid .product-card:hover,
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px -4px rgba(108, 60, 225, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    border-color: rgba(108, 60, 225, 0.35);
}

.product-card.is-out-of-stock {
    border-color: rgba(239, 68, 68, 0.3);
}

/* Consistent, Proportion-Preserving Media Container */
.category-products-grid .card-media,
.card-media {
    position: relative;
    width: 100%;
    height: 160px;
    background: #f8fafc;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
}

/* Preserve logo proportions; let logos occupy intended area without clipping */
.category-products-grid .card-media img,
.card-media img {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
    transition: transform 0.25s ease;
}

.category-products-grid .card-media img.fit-cover,
.card-media img.fit-cover {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
}

.category-products-grid .card-media img.fit-scale-down,
.card-media img.fit-scale-down {
    object-fit: scale-down !important;
}

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

.card-media-fallback {
    font-size: 2.8rem;
    color: var(--primary-light);
}

.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.68rem !important;
    padding: 2px 7px !important;
    max-width: 55%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-stock-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.66rem !important;
    padding: 2px 7px !important;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Aligned Card Body & Content */
.category-products-grid .card-body,
.card-body {
    padding: 14px 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-sizing: border-box;
}

.category-products-grid .card-title,
.card-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.35;
    margin: 0 0 6px 0;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    transition: color 0.15s ease;
    word-break: break-word;
}

.category-products-grid .card-title:hover,
.card-title:hover {
    color: var(--primary);
}

/* Short description only in card; full description kept out */
.category-products-grid .card-desc-snippet,
.card-desc-snippet {
    font-size: 0.84rem;
    color: var(--gray-600);
    line-height: 1.45;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
    word-break: break-word;
}

.card-plan-wrap {
    margin-bottom: 10px;
    width: 100%;
}

.card-plan-select {
    width: 100%;
    padding: 6px 9px;
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--gray-800);
    background: #f8fafc;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-plan-select:focus,
.card-plan-select:hover {
    border-color: var(--primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 60, 225, 0.12);
}

/* Price & Duration - Pushed to bottom of content area */
.category-products-grid .card-meta,
.card-meta {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.category-products-grid .card-price,
.card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.category-products-grid .card-original-price,
.card-original-price {
    font-size: 0.84rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.category-products-grid .card-duration,
.card-duration {
    margin-left: auto;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Action Buttons Stack - Comfortable, aligned side-by-side */
.category-products-grid .card-btn-stack,
.card-btn-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.category-products-grid .card-btn-stack .btn,
.card-btn-stack .btn {
    padding: 8px 6px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
}

.category-products-grid .card-btn-stack .btn i,
.card-btn-stack .btn i {
    font-size: 0.74rem;
}

/* ============================================================
   MOBILE RESPONSIVE 3x3 COMPACT CATALOG & SUPER SALE DESIGN
   Guarantees:
   - 3x3 grid on mobile (<= 640px)
   - Product variations/plan dropdown cleanly formatted with zero overlap
   - Both "Buy Online" and "WhatsApp" buttons 100% visible and easy to tap
   - High-contrast, attractive typography inspired by Super Sale cards
   ============================================================ */
@media (max-width: 640px) {
    /* Container breathing room */
    .product-section .container,
    .super-sale-section .container,
    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* 3x3 Responsive Grids for both Storefront Catalog and Super Sale */
    .category-products-grid,
    .super-sale-grid,
    .category-grid-3x3 {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .category-row-section {
        margin-bottom: 18px !important;
    }

    .category-row-header {
        margin-bottom: 8px !important;
        padding-bottom: 4px !important;
    }

    .category-row-title {
        font-size: 0.94rem !important;
        font-weight: 700 !important;
    }

    .category-row-badge {
        font-size: 0.65rem !important;
        padding: 1px 5px !important;
    }

    .category-row-see-all {
        font-size: 0.70rem !important;
        padding: 2px 6px !important;
    }

    /* Super Sale Header adjustments */
    .super-sale-section {
        padding: 10px 8px !important;
        margin-bottom: 16px !important;
    }

    .super-sale-title {
        font-size: 0.98rem !important;
    }

    .super-sale-subtitle {
        font-size: 0.70rem !important;
    }

    /* Card Outer Shell */
    .category-products-grid .product-card,
    .super-sale-grid .product-card,
    .category-grid-3x3 .product-card,
    .product-card {
        background: #ffffff !important;
        border: 1px solid var(--gray-200) !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        min-height: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        contain: none !important;
        overflow: hidden !important;
        transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    }

    /* Card Media / Logo Container */
    .category-products-grid .card-media,
    .super-sale-grid .card-media,
    .category-grid-3x3 .card-media,
    .card-media {
        position: relative !important;
        width: 100% !important;
        height: 84px !important;
        min-height: 84px !important;
        max-height: 84px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid var(--gray-200) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 4px 6px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .category-products-grid .card-media img,
    .super-sale-grid .card-media img,
    .category-grid-3x3 .card-media img,
    .card-media img {
        max-width: 86% !important;
        max-height: 86% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        margin: auto !important;
    }

    .card-media-fallback {
        font-size: 1.8rem !important;
    }

    /* Clean overlay badges on media */
    .category-products-grid .card-badge,
    .super-sale-grid .card-badge,
    .card-badge {
        display: none !important; /* Hide redundant category text over small image on mobile */
    }

    .card-stock-badge {
        position: absolute !important;
        top: 3px !important;
        right: 3px !important;
        font-size: 0.52rem !important;
        padding: 1px 4px !important;
        border-radius: 3px !important;
        line-height: 1.1 !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    }

    .card-sale-badge {
        position: absolute !important;
        top: 3px !important;
        left: 3px !important;
        font-size: 0.50rem !important;
        padding: 1px 4px !important;
        border-radius: 3px !important;
        line-height: 1.1 !important;
    }

    /* Card Content Body */
    .category-products-grid .card-body,
    .super-sale-grid .card-body,
    .category-grid-3x3 .card-body,
    .card-body {
        padding: 6px 5px 8px 5px !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        box-sizing: border-box !important;
    }

    /* Product Title: 2-line clamp with uniform row height */
    .category-products-grid .card-title,
    .super-sale-grid .card-title,
    .category-grid-3x3 .card-title,
    .card-title {
        font-size: 0.76rem !important;
        font-weight: 700 !important;
        color: var(--gray-900) !important;
        line-height: 1.22 !important;
        margin: 0 0 3px 0 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        min-height: 2.44em !important;
        max-height: 2.44em !important;
        word-break: break-word !important;
    }

    /* Hide long descriptions and custom tags on mobile to eliminate vertical bloat */
    .category-products-grid .card-desc-snippet,
    .super-sale-grid .card-desc-snippet,
    .card-desc-snippet,
    .card-tags-list {
        display: none !important;
    }

    /* Product Variation Selector Dropdown - Clean & Guaranteed No Overlap */
    .card-plan-wrap,
    .super-sale-grid .product-card div[style*="margin-bottom"] {
        width: 100% !important;
        margin: 2px 0 4px 0 !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    .card-plan-select,
    .super-sale-grid .card-plan-select {
        width: 100% !important;
        height: 24px !important;
        min-height: 24px !important;
        padding: 1px 3px !important;
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        color: var(--gray-800) !important;
        background: #f8fafc !important;
        border: 1px solid var(--gray-300) !important;
        border-radius: 4px !important;
        box-sizing: border-box !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        display: block !important;
        line-height: 22px !important;
        cursor: pointer !important;
    }

    /* Price, Original Price & Duration Meta Area */
    .category-products-grid .card-meta,
    .super-sale-grid .card-meta,
    .category-grid-3x3 .card-meta,
    .card-meta {
        margin-top: auto !important;
        margin-bottom: 5px !important;
        display: flex !important;
        align-items: baseline !important;
        justify-content: space-between !important;
        gap: 2px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-wrap: nowrap !important;
    }

    .category-products-grid .card-price,
    .category-grid-3x3 .card-price,
    .card-price {
        font-size: 0.85rem !important;
        font-weight: 800 !important;
        color: var(--primary) !important;
        letter-spacing: -0.01em !important;
        white-space: nowrap !important;
        line-height: 1.15 !important;
    }

    .super-sale-grid .card-price {
        font-size: 0.85rem !important;
        font-weight: 800 !important;
        color: #ea580c !important;
        letter-spacing: -0.01em !important;
        white-space: nowrap !important;
        line-height: 1.15 !important;
    }

    .card-original-price {
        font-size: 0.62rem !important;
        color: var(--gray-400) !important;
        text-decoration: line-through !important;
        white-space: nowrap !important;
        margin-left: 2px !important;
    }

    .card-discount-tag {
        font-size: 0.52rem !important;
        font-weight: 800 !important;
        color: #fff !important;
        background: linear-gradient(135deg, #ff7800 0%, #ea580c 100%) !important;
        padding: 1px 3px !important;
        border-radius: 3px !important;
        white-space: nowrap !important;
    }

    .category-products-grid .card-duration,
    .super-sale-grid .card-duration,
    .category-grid-3x3 .card-duration,
    .card-duration {
        font-size: 0.58rem !important;
        font-weight: 600 !important;
        color: var(--gray-600) !important;
        background: var(--gray-100) !important;
        padding: 1px 3px !important;
        border-radius: 3px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 48% !important;
        margin-left: auto !important;
    }

    /* Buttons Stack: Both "Buy Online" & "WhatsApp" 100% visible, fully tap-friendly */
    .category-products-grid .card-btn-stack,
    .super-sale-grid .card-btn-stack,
    .category-grid-3x3 .card-btn-stack,
    .card-btn-stack {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 3.5px !important;
        width: 100% !important;
        margin-top: 4px !important;
        box-sizing: border-box !important;
    }

    .category-products-grid .card-btn-stack .btn,
    .super-sale-grid .card-btn-stack .btn,
    .category-grid-3x3 .card-btn-stack .btn,
    .card-btn-stack .btn {
        width: 100% !important;
        height: 26px !important;
        min-height: 26px !important;
        max-height: 26px !important;
        padding: 0 3px !important;
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        border-radius: 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        box-sizing: border-box !important;
        line-height: 1 !important;
        border: none !important;
        cursor: pointer !important;
        transition: opacity 0.15s ease, transform 0.1s ease !important;
    }

    .category-products-grid .card-btn-stack .btn:active,
    .super-sale-grid .card-btn-stack .btn:active,
    .card-btn-stack .btn:active {
        transform: scale(0.98) !important;
    }

    .category-products-grid .card-btn-stack .btn i,
    .super-sale-grid .card-btn-stack .btn i,
    .card-btn-stack .btn i {
        font-size: 0.65rem !important;
        margin-right: 2px !important;
    }

    /* Buy Online: High contrast primary */
    .card-btn-stack .btn-accent {
        background: var(--primary) !important;
        color: #ffffff !important;
        box-shadow: 0 1px 3px rgba(108, 60, 225, 0.25) !important;
    }

    /* WhatsApp: Official green */
    .card-btn-stack .btn-whatsapp {
        background: #25D366 !important;
        color: #ffffff !important;
        box-shadow: 0 1px 3px rgba(37, 211, 102, 0.25) !important;
    }

    .card-btn-stack .btn-out-of-stock {
        background: #f1f5f9 !important;
        color: #94a3b8 !important;
        border: 1px solid #cbd5e1 !important;
    }
}

/* Backward compatibility for legacy slider references */
.category-row-track-wrap {
    width: 100%;
    max-width: 100%;
}
.category-row-track {
    width: 100%;
}
.category-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

/* Category Row Draggable Styles (Admin Panel) */
.draggable-cat-row {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}
.draggable-cat-row td {
    user-select: none !important;
    -webkit-user-select: none !important;
}
.draggable-cat-row .drag-handle {
    cursor: grab !important;
    cursor: -webkit-grab !important;
    pointer-events: none !important;
}
.draggable-cat-row.drag-over {
    border-top: 2.5px solid var(--primary) !important;
    background: #eef2ff !important;
}
.draggable-cat-row.dragging {
    opacity: 0.45 !important;
    background: #f1f5f9 !important;
}
.draggable-cat-row .drag-handle:hover {
    color: var(--primary) !important;
}


/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    contain: content;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(108, 60, 225, 0.25);
}

.card-media {
    position: relative;
    width: 100%;
    height: 165px;
    background: var(--gray-100);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card:hover .card-media img {
    transform: scale(1.04);
}
.card-media-fallback {
    font-size: 2.8rem;
    color: var(--primary-light);
}

.card-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    font-size: 0.66rem !important;
    padding: 2px 7px !important;
    max-width: 54%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.card-stock-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 0.64rem !important;
    padding: 2px 6px !important;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
    .card-badge {
        top: 5px;
        left: 5px;
        font-size: 0.60rem !important;
        padding: 1.5px 5px !important;
        max-width: 50%;
    }
    .card-stock-badge {
        top: 5px;
        right: 5px;
        font-size: 0.58rem !important;
        padding: 1.5px 5px !important;
    }
}

.card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    line-height: 1.35;
}
.card-desc-snippet {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 14px;
}
.card-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}
.card-original-price {
    font-size: 0.88rem;
    color: var(--gray-400);
    text-decoration: line-through;
}
.card-duration {
    margin-left: auto;
    font-size: 0.78rem;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Multi-Tier Pricing & Plan Selector */
.card-plan-select {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-800);
    background: #f8fafc;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.card-plan-select:focus, .card-plan-select:hover {
    border-color: var(--primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.12);
}

.plan-pill-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-300);
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.plan-pill-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--gray-50);
}
.plan-pill-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(108, 60, 225, 0.25);
}

/* Two-Option Purchase Button Stack */
.card-btn-stack {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.card-btn-stack .btn {
    flex: 1;
    padding: 9px 8px;
    font-size: 0.82rem;
}

/* Shimmering Skeleton Loader */
.product-card-skeleton {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    padding: 16px;
}
.skeleton-box {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty & Error State Cards */
.empty-catalog-box,
.error-catalog-box {
    grid-column: 1 / -1;
    background: #fff;
    border: 1.5px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    margin: 20px 0;
}
.empty-catalog-box i,
.error-catalog-box i {
    font-size: 2.8rem;
    color: var(--gray-400);
    margin-bottom: 12px;
}
.error-catalog-box i {
    color: var(--danger);
}

/* Customer Account Hub Tabs */
.account-tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
}
.account-tab-btn {
    background: transparent;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    position: relative;
    white-space: nowrap;
}
.account-tab-btn:hover {
    color: var(--gray-800);
}
.account-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.account-tab-btn .badge-pill {
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: 4px;
}

/* Digital Delivery Credential Box */
.license-key-box {
    background: #1e1e2e;
    color: #50fa7b;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    word-break: break-all;
}
.copy-key-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.76rem;
    margin-left: 10px;
}
.copy-key-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Customer Support Ticket Chat Messages */
.ticket-chat-messages {
    max-height: 360px;
    overflow-y: auto;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0;
}
.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    position: relative;
}
.chat-msg-customer {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
}
.chat-msg-admin {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
}
.chat-msg-meta {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.75;
    text-align: right;
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--whatsapp-green);
    color: #fff;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
    z-index: 8000;
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.2s ease;
}
.whatsapp-float:hover {
    transform: scale(1.08) translateZ(0);
}

/* Store Footer */
.store-footer {
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 48px 0 24px;
    color: var(--gray-600);
    font-size: 0.88rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 36px;
}
.footer-brand h3 {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
}
.footer-col h4 {
    color: var(--gray-900);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.footer-links a:hover {
    color: var(--primary);
}
.footer-bottom {
    border-top: 1px solid var(--gray-200);
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--gray-400);
}

/* ============================================================
   ADMIN CONTROL PANEL STYLES
   ============================================================ */

/* Admin Login Overlay Card */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    background: #0f172a;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.admin-login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 100%;
    padding: 36px 32px;
    text-align: center;
}
.admin-login-card h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 6px;
}
.admin-login-card p {
    color: var(--gray-500);
    font-size: 0.88rem;
    margin-bottom: 24px;
}

/* Admin Header Bar */
.admin-header-bar {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 500;
}
.admin-header-bar .container-wide {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-brand span {
    color: var(--gray-900);
}
.admin-brand small {
    font-size: 0.72rem;
    background: var(--primary-bg);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

/* Admin Workspace Grid */
.admin-wrap {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    padding: 24px 0 60px;
    min-height: calc(100vh - 65px);
}

/* Admin Sidebar */
.admin-sidebar {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 80px;
}
.admin-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-600);
    transition: var(--transition-fast);
}
.admin-nav a:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}
.admin-nav a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 60, 225, 0.25);
}
.admin-nav a .badge {
    margin-left: auto;
    font-size: 0.72rem;
    background: var(--danger);
    color: #fff;
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

/* Admin Main Content Container */
.admin-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    max-width: 100%;
}

/* Admin Section Cards */
.admin-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    max-width: 100%;
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-100);
}
.admin-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Dashboard Stats Grid (10 Cards) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.stat-card .num {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.stat-card .label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Tables & Data Display */
.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: #fff;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    margin-top: 10px;
}
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.79rem;
    text-align: left;
    min-width: 600px;
}
#adminOrdersTable {
    min-width: 640px;
}
#adminUsersTable {
    min-width: 580px;
}
#adminProductsTable {
    min-width: 640px;
}
#adminRecordsTable {
    min-width: 660px;
}
#adminExpiredOrdersTable {
    min-width: 600px;
}
.admin-table th {
    background: var(--gray-50);
    padding: 8px 10px;
    font-weight: 700;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.admin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
    vertical-align: middle;
    line-height: 1.35;
    word-break: break-word;
}
.admin-table tr:hover td {
    background: #faf9fe;
}
.admin-table td.actions-cell,
.admin-table td:last-child {
    white-space: nowrap;
    text-align: right;
}
.admin-table-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.order-status-select {
    display: inline-block;
    width: auto;
    min-width: 105px;
    max-width: 130px;
    padding: 4px 6px;
    font-size: 0.76rem;
    font-weight: 600;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    background-color: #fff;
    color: var(--gray-800);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.order-status-select:focus {
    border-color: var(--primary);
}

/* Pagination Control Bars */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px 4px 4px;
    font-size: 0.81rem;
    color: var(--gray-600);
    flex-wrap: wrap;
    gap: 10px;
}
.pagination-info {
    font-weight: 500;
    font-size: 0.80rem;
}
.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pagination-current-pill {
    padding: 3px 10px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-weight: 700;
    color: var(--gray-800);
    font-size: 0.78rem;
}

/* Delivery Modal Tabs & Modes */
.delivery-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1.5px solid var(--gray-200);
    padding-bottom: 10px;
    overflow-x: auto;
}
.delivery-tab-btn {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.delivery-tab-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}
.delivery-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(108, 60, 225, 0.25);
}
.delivery-mode-panel {
    margin-bottom: 14px;
}
.delivery-preset-btn {
    font-size: 0.76rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

/* Expiry Alert Banners */
.expiry-alert-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    line-height: 1.4;
}
.expiry-alert-warning {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    color: #92400e;
}
.expiry-alert-danger {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    color: #991b1b;
}

/* Fixed 64x64px Square Thumbnails for Admin Tables */
.product-thumb-container {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.product-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}
.product-thumb-container:hover img {
    transform: scale(1.1);
}
.product-thumb-fallback {
    font-size: 1.5rem;
    color: var(--gray-400);
}

/* Drag-and-Drop Image Uploader */
.image-upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    background: var(--gray-50);
    transition: var(--transition-fast);
}
.image-upload-zone:hover,
.image-upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.image-upload-zone i {
    font-size: 2rem;
    color: var(--gray-400);
    margin-bottom: 8px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: #1f2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastSlideUp 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: #fff; }
.toast.info { background: var(--info); }
@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE DESIGN & MOBILE LAYOUT RULES
   ============================================================ */
@media (max-width: 992px) {
    .admin-wrap {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        position: static;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .store-header .container {
        flex-wrap: wrap;
    }
    .store-search-wrap {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .modal-card {
        padding: 20px;
    }
    .card-btn-stack {
        flex-direction: column;
    }
}

/* ============================================================
   CUSTOM BRAND LOGO & TICK CAPTCHA WIDGET
   ============================================================ */
.brand-custom-logo {
    max-height: 38px;
    max-width: 160px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.captcha-box {
    background: #f8fafc;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: var(--transition);
}
.captcha-box:hover {
    border-color: var(--primary);
    background: #f1f5f9;
}
.captcha-box.verified {
    border-color: var(--success);
    background: #f0fdf4;
}
.captcha-box.error {
    border-color: var(--danger) !important;
    background: #fef2f2 !important;
    animation: captchaShake 0.4s ease;
}
@keyframes captchaShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.captcha-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.captcha-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-400);
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.82rem;
}
.captcha-box:hover .captcha-checkbox {
    border-color: var(--primary);
}
.captcha-box.verifying .captcha-checkbox {
    border-color: var(--primary);
    border-top-color: transparent !important;
    border-radius: 50% !important;
    animation: captchaSpin 0.7s linear infinite;
    background: transparent !important;
}
@keyframes captchaSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.captcha-box.verified .captcha-checkbox {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}
.captcha-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
}
.captcha-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
    color: var(--gray-400);
    line-height: 1.2;
    text-align: center;
}
.captcha-badge i {
    font-size: 1.15rem;
    color: var(--primary);
    margin-bottom: 2px;
}

/* ============================================================
   SUPER OFFER SALE SECTION STYLES (Sunburst Orange Edition - Compact)
   ============================================================ */
.super-sale-section {
    background: radial-gradient(circle at 10% 0%, rgba(255, 122, 0, 0.06) 0%, rgba(255, 245, 235, 0.5) 45%, #ffffff 85%), #ffffff;
    border: 1.5px solid #f97316;
    border-top: 3.5px solid #ea580c;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px -4px rgba(249, 115, 22, 0.12), 0 2px 6px rgba(249, 115, 22, 0.05);
    padding: 16px 20px;
    margin-bottom: 22px;
    position: relative;
    contain: content;
}

.super-sale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.super-sale-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #ff7800 0%, #ea580c 100%);
    color: #fff;
    margin-bottom: 3px;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
}

.super-sale-title {
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 45%, #ff7800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.2;
}

.super-sale-subtitle {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.super-sale-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.super-sale-nav-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    font-size: 0.76rem;
    transition: var(--transition-fast);
}

.super-sale-nav-btn:hover:not(:disabled) {
    border-color: #ea580c;
    color: #ea580c;
    background: #fff7ed;
}

.super-sale-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.super-sale-page-indicator {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--gray-600);
    min-width: 36px;
    text-align: center;
    user-select: none;
}

.super-sale-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.super-sale-grid .product-card {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(249, 115, 22, 0.16);
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.super-sale-grid .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px -2px rgba(249, 115, 22, 0.22);
    border-color: rgba(249, 115, 22, 0.45);
}

.super-sale-grid .card-media {
    height: 110px;
    max-height: 110px;
    position: relative;
    background: #fff7ed;
    overflow: hidden;
}

.super-sale-grid .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.super-sale-grid .product-card:hover .card-media img {
    transform: scale(1.05);
}

.super-sale-grid .card-media-fallback {
    font-size: 2rem;
    color: #f97316;
}

.super-sale-grid .card-sale-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.60rem !important;
    padding: 2px 6px !important;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 4px rgba(249, 115, 22, 0.3);
}

.super-sale-grid .card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    left: auto;
    font-size: 0.58rem !important;
    padding: 2px 6px !important;
}

.super-sale-grid .card-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.super-sale-grid .card-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 4px;
    color: var(--gray-900);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.super-sale-grid .card-desc-snippet {
    font-size: 0.74rem;
    line-height: 1.3;
    color: var(--gray-500);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.super-sale-grid .card-plan-select {
    padding: 3px 6px;
    font-size: 0.72rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    width: 100%;
    margin-bottom: 6px;
    background: var(--gray-50);
}

.super-sale-grid .card-meta {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.super-sale-grid .card-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ea580c;
}

.super-sale-grid .card-original-price {
    font-size: 0.72rem;
    text-decoration: line-through;
    color: var(--gray-400);
}

.super-sale-grid .card-discount-tag {
    font-size: 0.60rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #ff7800 0%, #ea580c 100%);
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.02em;
    display: inline-block;
}

.super-sale-grid .card-duration {
    font-size: 0.68rem;
    color: var(--gray-500);
    font-weight: 500;
}

.super-sale-grid .card-btn-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: auto;
}

.super-sale-grid .card-btn-stack .btn {
    padding: 4px 6px;
    font-size: 0.70rem;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

@media (max-width: 1024px) {
    .super-sale-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) and (min-width: 641px) {
    .super-sale-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .super-sale-section {
        padding: 14px 14px;
        margin-bottom: 18px;
    }
}

@media (max-width: 640px) {
    .super-sale-section {
        padding: 12px 10px;
        margin-bottom: 16px;
        border-width: 1.5px;
        border-top-width: 3px;
    }
    .super-sale-header {
        margin-bottom: 10px;
        gap: 6px;
    }
    .super-sale-title {
        font-size: 1.05rem;
    }
    .super-sale-subtitle {
        font-size: 0.72rem;
    }
    .super-sale-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }
    .super-sale-grid .card-media {
        height: 84px !important;
        max-height: 84px !important;
        min-height: 84px !important;
    }
    .super-sale-grid .card-body {
        padding: 6px 5px 8px 5px !important;
    }
    .super-sale-grid .card-desc-snippet {
        display: none !important;
    }
    .super-sale-grid .card-btn-stack {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 3.5px !important;
    }
    .super-sale-grid .card-btn-stack .btn {
        height: 26px !important;
        min-height: 26px !important;
        max-height: 26px !important;
        font-size: 0.68rem !important;
        font-weight: 700 !important;
    }
}

/* Motion reduction preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   PRODUCT DETAIL MODAL & DURATION BUILDER ENHANCEMENTS
   ============================================================ */
.product-detail-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.modal-product-media-wrap,
#modalProductMedia,
#modalProductMediaWrap {
    background: var(--gray-100);
    border-radius: var(--radius);
    overflow: hidden;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    position: relative;
}

.modal-product-media-wrap img,
#modalProductMedia img,
#modalProductMediaWrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wa-dur-preset,
.wa-dur-add {
    font-size: 0.74rem !important;
    padding: 3px 8px !important;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
}

.wa-dur-preset:hover,
.wa-dur-add:hover {
    background: var(--primary-lightest, #eff6ff);
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 680px) {
    .product-detail-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .modal-product-media-wrap,
    #modalProductMedia,
    #modalProductMediaWrap {
        height: 210px !important;
    }
    #waDurationBuilderRow {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ============================================================
   ADMIN IMPERSONATION (LOGIN AS USER) STYLES
   ============================================================ */
.impersonation-top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(90deg, #9a3412 0%, #c2410c 45%, #ea580c 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    padding: 8px 18px;
    font-size: 0.86rem;
    font-weight: 600;
}

.impersonation-banner-inner {
    max-width: 1360px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.impersonation-banner-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.impersonation-badge {
    background: rgba(255, 255, 255, 0.24);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.70rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
}

.impersonation-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.impersonation-exit-btn {
    background: #fff !important;
    color: #c2410c !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    padding: 4px 12px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.78rem !important;
    cursor: pointer;
    transition: var(--transition-fast);
}

.impersonation-exit-btn:hover {
    background: #fff7ed !important;
    transform: translateY(-1px);
}

body.impersonation-active {
    padding-top: 44px !important;
}

body.impersonation-active .store-header {
    top: 44px !important;
}

.btn-login-as-user {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #fff !important;
    font-weight: 600 !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px !important;
    font-size: 0.74rem !important;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.btn-login-as-user:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    transform: translateY(-1px);
}

/* ============================================================
   FAMILY SHARING MODULE STYLES
   ============================================================ */
.family-nav-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1.5px solid var(--gray-200);
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.family-tab-btn {
    padding: 9px 15px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition-fast);
    white-space: nowrap;
    border-bottom: 2.5px solid transparent;
}

.family-tab-btn:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.family-tab-btn.active {
    color: var(--primary);
    font-weight: 700;
    background: #fff;
    border-bottom-color: var(--primary);
}

.family-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.family-stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.family-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.family-stat-card .num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.15;
}

.family-stat-card .label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.family-stat-card.stat-green .num { color: var(--success); }
.family-stat-card.stat-red .num { color: var(--danger); }
.family-stat-card.stat-orange .num { color: var(--warning-dark); }
.family-stat-card.stat-primary .num { color: var(--primary); }

.family-utilization-bar-wrap {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
}

.family-bar-container {
    height: 12px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 8px 0;
    display: flex;
}

.family-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8b6bf0);
    transition: width 0.4s ease;
}

.family-hosts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.family-host-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-fast);
    position: relative;
}

.family-host-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.family-host-card.host-full {
    border-left: 4px solid var(--danger);
}

.family-host-card.host-open {
    border-left: 4px solid var(--success);
}

.family-host-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.family-host-prod-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.family-host-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gray-900);
}

.badge-open {
    background: var(--success-bg);
    color: var(--success-dark);
    border: 1px solid var(--success);
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-full {
    background: var(--danger-bg);
    color: var(--danger-dark);
    border: 1px solid var(--danger);
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-expiring {
    background: var(--warning-bg);
    color: var(--warning-dark);
    border: 1px solid var(--warning);
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-expired {
    background: var(--gray-200);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.family-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.family-product-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-fast);
}

.family-product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.family-product-media {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.family-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.family-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.family-filter-input {
    flex: 1;
    min-width: 220px;
    padding: 8px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    background: #fff;
}

.family-filter-select {
    padding: 8px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    background: #fff;
}

@media (max-width: 768px) {
    .family-hosts-grid,
    .family-products-grid {
        grid-template-columns: 1fr;
    }
    .family-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ----------------------------------------------------
   FAMILY SHARING CREDENTIALS & TOTP STYLES
   ---------------------------------------------------- */
.btn-purple {
    background: #7e22ce;
    color: #fff;
    border: 1px solid #7e22ce;
    box-shadow: 0 1px 3px rgba(126, 34, 206, 0.2);
}
.btn-purple:hover:not(:disabled) {
    background: #6b21a8;
    color: #fff;
}
.badge-family-shared {
    background: #6366f1;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}
.family-member-access-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 10px;
}
.badge-totp-active {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #d8b4fe;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
}
.badge-creds-active {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
}
.badge-unlinked {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

/* ==========================================================
   FAMILY SHARING V2 — compact dark-slate admin tables
   Scoped to #family-subpane-accounts so other sections are
   visually unchanged.
   ========================================================== */
#family-subpane-accounts {
    --fs-bg: #0f172a;
    --fs-bg-alt: #16203a;
    --fs-row: #1a2540;
    --fs-row-hover: #223054;
    --fs-line: #2b3a5c;
    --fs-text: #e2e8f5;
    --fs-muted: #93a3c4;
    --fs-cyan: #22d3ee;
    --fs-cyan-dark: #0e7490;
    --fs-green: #16a34a;
    --fs-green-hi: #22c55e;
    background: var(--fs-bg);
    border-radius: var(--radius-sm);
    padding: 14px;
    color: var(--fs-text);
}
#family-subpane-accounts .fs-view.hidden { display: none; }

#family-subpane-accounts .fs-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
#family-subpane-accounts .fs-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}
#family-subpane-accounts .fs-input,
#family-subpane-accounts .fs-select {
    background: var(--fs-bg-alt);
    border: 1px solid var(--fs-line);
    color: var(--fs-text);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.82rem;
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 380px;
}
#family-subpane-accounts .fs-input::placeholder { color: #6f809f; }
#family-subpane-accounts .fs-input:focus,
#family-subpane-accounts .fs-select:focus {
    outline: none;
    border-color: var(--fs-cyan);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}

/* Breadcrumbs */
#family-subpane-accounts .fs-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 0.82rem;
}
#family-subpane-accounts .fs-back {
    background: var(--fs-bg-alt);
    border: 1px solid var(--fs-line);
    color: var(--fs-cyan);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
#family-subpane-accounts .fs-back:hover { background: var(--fs-row-hover); }
#family-subpane-accounts .fs-crumb-link {
    background: none;
    border: none;
    color: var(--fs-cyan);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0;
}
#family-subpane-accounts .fs-crumb-link:hover { text-decoration: underline; }
#family-subpane-accounts .fs-crumb-sep { color: var(--fs-muted); }
#family-subpane-accounts .fs-crumb-current { color: var(--fs-text); font-weight: 700; }

/* Tables */
#family-subpane-accounts .fs-table-wrap {
    border: 1px solid var(--fs-line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    background: var(--fs-bg-alt);
    -webkit-overflow-scrolling: touch;
}
#family-subpane-accounts .fs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 720px;
}
#family-subpane-accounts .fs-table thead th {
    background: #121c33;
    color: var(--fs-muted);
    text-align: left;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 9px 10px;
    border-bottom: 1px solid var(--fs-line);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
#family-subpane-accounts .fs-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--fs-line);
    color: var(--fs-text);
    vertical-align: middle;
}
#family-subpane-accounts .fs-table tbody tr { background: var(--fs-row); }
#family-subpane-accounts .fs-table tbody tr:nth-child(even) { background: #17213a; }
#family-subpane-accounts .fs-table tbody tr:hover { background: var(--fs-row-hover); }
#family-subpane-accounts .fs-table tbody tr:last-child td { border-bottom: none; }
#family-subpane-accounts .fs-empty {
    text-align: center;
    padding: 28px 12px;
    color: var(--fs-muted);
}
#family-subpane-accounts .fs-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.80rem;
    word-break: break-all;
}
#family-subpane-accounts .fs-sub {
    display: block;
    color: var(--fs-muted);
    font-size: 0.72rem;
    margin-top: 2px;
}
#family-subpane-accounts .fs-prod-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
#family-subpane-accounts .fs-prod-img {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    object-fit: cover;
    background: #0b1222;
    border: 1px solid var(--fs-line);
    flex-shrink: 0;
}
#family-subpane-accounts .fs-prod-img-ph {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: #0b1222;
    border: 1px solid var(--fs-line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fs-muted);
    flex-shrink: 0;
}

/* Buttons */
#family-subpane-accounts .fs-btn {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.5;
}
#family-subpane-accounts .fs-btn-open {
    background: var(--fs-green);
    color: #fff;
}
#family-subpane-accounts .fs-btn-open:hover { background: var(--fs-green-hi); }
#family-subpane-accounts .fs-btn-cyan {
    background: var(--fs-cyan-dark);
    border-color: var(--fs-cyan-dark);
    color: #e0fbff;
}
#family-subpane-accounts .fs-btn-cyan:hover { background: #0891b2; }
#family-subpane-accounts .fs-btn-ghost {
    background: transparent;
    border-color: var(--fs-line);
    color: var(--fs-text);
}
#family-subpane-accounts .fs-btn-ghost:hover { background: var(--fs-row-hover); border-color: var(--fs-cyan); }
#family-subpane-accounts .fs-btn-danger {
    background: transparent;
    border-color: #7f1d1d;
    color: #fca5a5;
}
#family-subpane-accounts .fs-btn-danger:hover { background: #7f1d1d; color: #fff; }
#family-subpane-accounts .fs-actions {
    display: inline-flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Badges / pills */
#family-subpane-accounts .fs-pill {
    display: inline-block;
    font-size: 0.70rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    border: 1px solid transparent;
}
#family-subpane-accounts .fs-pill-ok { background: rgba(22, 163, 74, 0.18); color: #6ee7a8; border-color: #15803d; }
#family-subpane-accounts .fs-pill-full { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-color: #b45309; }
#family-subpane-accounts .fs-pill-over { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: #b91c1c; }
#family-subpane-accounts .fs-pill-muted { background: #22304f; color: var(--fs-muted); border-color: var(--fs-line); }
#family-subpane-accounts .fs-pill-cyan { background: rgba(34, 211, 238, 0.14); color: #67e8f9; border-color: var(--fs-cyan-dark); }

/* Assignment ON/OFF toggle */
#family-subpane-accounts .fs-toggle {
    border: 1px solid var(--fs-line);
    border-radius: var(--radius-full);
    background: #22304f;
    color: var(--fs-muted);
    font-size: 0.70rem;
    font-weight: 800;
    padding: 3px 10px;
    cursor: pointer;
    white-space: nowrap;
}
#family-subpane-accounts .fs-toggle.on {
    background: rgba(34, 211, 238, 0.16);
    color: #67e8f9;
    border-color: var(--fs-cyan-dark);
}
#family-subpane-accounts .fs-toggle:hover { filter: brightness(1.18); }

/* Detail page */
#family-subpane-accounts .fs-card {
    background: var(--fs-bg-alt);
    border: 1px solid var(--fs-line);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 14px;
}
#family-subpane-accounts .fs-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
#family-subpane-accounts .fs-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--fs-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
#family-subpane-accounts .fs-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
#family-subpane-accounts .fs-kv {
    background: #131d33;
    border: 1px solid var(--fs-line);
    border-radius: 6px;
    padding: 7px 10px;
    min-width: 0;
}
#family-subpane-accounts .fs-kv-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fs-muted);
    margin-bottom: 3px;
}
#family-subpane-accounts .fs-kv-value {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--fs-text);
    word-break: break-word;
}
#family-subpane-accounts .fs-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: #14233d;
    border: 1px solid var(--fs-line);
    color: var(--fs-text);
}
#family-subpane-accounts .fs-note-warn { background: rgba(180, 83, 9, 0.16); border-color: #b45309; color: #fcd34d; }
#family-subpane-accounts .fs-note-danger { background: rgba(185, 28, 28, 0.16); border-color: #b91c1c; color: #fca5a5; }
#family-subpane-accounts .fs-reveal-yes { color: #4ade80; font-weight: 800; }
#family-subpane-accounts .fs-reveal-no { color: #f87171; font-weight: 800; }
#family-subpane-accounts .fs-section-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--fs-text);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Modal form grid reused by the v2 credential/assign modals */
.fs-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0 14px;
}
.fs-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.80rem;
    border-radius: 6px;
    padding: 8px 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
}
.fs-note-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.fs-note-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.fs-note-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* Mobile: turn wide tables into stacked cards */
@media (max-width: 760px) {
    #family-subpane-accounts { padding: 10px; }
    #family-subpane-accounts .fs-input,
    #family-subpane-accounts .fs-select { max-width: none; }
    #family-subpane-accounts .fs-toolbar-actions { margin-left: 0; width: 100%; }
    #family-subpane-accounts .fs-toolbar-actions .btn { flex: 1 1 auto; }

    #family-subpane-accounts .fs-table { min-width: 0; }
    #family-subpane-accounts .fs-table thead { display: none; }
    #family-subpane-accounts .fs-table,
    #family-subpane-accounts .fs-table tbody,
    #family-subpane-accounts .fs-table tr,
    #family-subpane-accounts .fs-table td { display: block; width: 100%; }
    #family-subpane-accounts .fs-table tbody tr {
        border: 1px solid var(--fs-line);
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 4px 0;
        background: var(--fs-row);
    }
    #family-subpane-accounts .fs-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        border-bottom: 1px dashed var(--fs-line);
        padding: 7px 10px;
        text-align: right;
    }
    #family-subpane-accounts .fs-table tbody td:last-child { border-bottom: none; }
    #family-subpane-accounts .fs-table tbody td::before {
        content: attr(data-label);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--fs-muted);
        text-align: left;
        flex-shrink: 0;
    }
    #family-subpane-accounts .fs-table tbody td[data-label=""]::before { content: none; }
    #family-subpane-accounts .fs-prod-cell { justify-content: flex-end; }
    #family-subpane-accounts .fs-actions { justify-content: flex-end; }
    #family-subpane-accounts .fs-kv-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   REAL-TIME ORDER DELIVERY GREEN LED BLINKING & HIGHLIGHTS
   ============================================================ */
.delivery-led-indicator {
    display: inline-block;
    width: 9px;
    height: 9px;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.9);
    animation: deliveryLedBlink 1.1s infinite ease-in-out;
}

@keyframes deliveryLedBlink {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.95), 0 0 6px #10b981;
        opacity: 0.85;
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 0 7px rgba(16, 185, 129, 0), 0 0 12px #34d399;
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), 0 0 6px #10b981;
        opacity: 0.85;
    }
}

.delivery-led-badge {
    display: inline-block;
    background: #059669;
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    animation: deliveryBadgePulse 1.6s infinite ease-in-out;
}

@keyframes deliveryBadgePulse {
    0%, 100% {
        background-color: #059669;
        box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
    }
    50% {
        background-color: #10b981;
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    }
}

.btn.has-new-delivery {
    border-color: #10b981 !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
    animation: btnDeliveryPulse 1.6s infinite ease-in-out;
}

@keyframes btnDeliveryPulse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 14px rgba(16, 185, 129, 0.7);
    }
}

.order-new-delivery-glow {
    border: 2px solid #10b981 !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.25) !important;
}

/* Out of Stock Styling */
.product-card.is-out-of-stock .card-media img {
    filter: grayscale(35%) opacity(0.85);
}

.card-stock-badge.tag-danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #f87171 !important;
    font-weight: 700 !important;
}

.super-sale-grid .card-stock-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    font-size: 0.60rem !important;
    padding: 2px 6px !important;
    z-index: 2;
}

.btn-out-of-stock {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border: 1px solid #cbd5e1 !important;
    cursor: not-allowed !important;
    font-weight: 700 !important;
}

/* ============================================================
   Agent 2: Custom Product Tags, Storefront Badges & SEO Styles
   ============================================================ */
.card-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 8px 0;
}

.product-custom-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(108, 60, 225, 0.08);
    color: var(--primary);
    border: 1px solid rgba(108, 60, 225, 0.2);
    font-size: 0.70rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition-fast);
}

.product-custom-tag:hover {
    background: var(--primary);
    color: #ffffff;
}

.modal-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 14px 0;
}

.product-form-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    min-height: 42px;
    background: #fff;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    align-items: center;
}

.product-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ede9fe;
    color: #6d28d9;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.product-tag-chip .tag-remove-btn {
    background: none;
    border: none;
    color: #6d28d9;
    cursor: pointer;
    padding: 0;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    line-height: 1;
}

.product-tag-chip .tag-remove-btn:hover {
    color: #b91c1c;
}

/* SEO Modal Styles */
.seo-modal-card {
    max-width: 820px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.seo-serp-preview {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0 20px 0;
    font-family: Arial, sans-serif;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
}

.seo-serp-site {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.seo-serp-favicon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.seo-serp-sitename {
    font-size: 0.85rem;
    color: #202124;
    font-weight: 500;
}

.seo-serp-url {
    font-size: 0.75rem;
    color: #4d5156;
}

.seo-serp-title {
    font-size: 1.15rem;
    color: #1a0dab;
    line-height: 1.3;
    font-weight: 400;
    margin-bottom: 4px;
    text-decoration: none;
    cursor: pointer;
}

.seo-serp-title:hover {
    text-decoration: underline;
}

.seo-serp-desc {
    font-size: 0.85rem;
    color: #4d5156;
    line-height: 1.45;
}

.seo-char-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-align: right;
    margin-top: 2px;
}

.seo-char-count.good {
    color: #15803d;
}

.seo-char-count.warn {
    color: #b45309;
}

.seo-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.seo-faq-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px;
    position: relative;
}

.seo-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.seo-status-saved {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.seo-status-pending {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* Similar Products Grid & Product Detail Modal Responsive Fitting */
#productDetailModal .modal-card {
    max-width: 880px;
    padding: 18px 22px;
    max-height: 92vh;
}
.product-detail-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 18px;
    align-items: start;
}
.modal-product-media-wrap {
    height: 190px;
}
.modal-similar-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    width: 100%;
}
.similar-prod-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.similar-prod-card:hover {
    background: #eef2ff !important;
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.12);
}

@media (max-width: 768px) {
    #productDetailModal .modal-card {
        padding: 14px 14px 16px !important;
        max-height: 94vh !important;
    }
    .product-detail-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .modal-product-media-wrap {
        height: 130px !important;
    }
    .modal-similar-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    .similar-prod-card {
        padding: 5px 8px !important;
    }
}

@media (max-width: 480px) {
    .modal-similar-products-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    .similar-prod-card h5 {
        font-size: 0.72rem !important;
    }
    .similar-prod-card span {
        font-size: 0.7rem !important;
    }
}

/* Footer Review Badges */
.footer-review-card:hover {
    transform: translateY(-2px);
    opacity: 0.92;
}

/* Shared Account Password Rotation & Expiry Security Alerts */
.fs-pw-alert-banner {
    background: #fff1f2;
    border: 1.5px solid #fecdd3;
    border-left: 5px solid #e11d48;
    border-radius: var(--radius, 8px);
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.08);
}
.fs-pw-alert-banner-icon {
    font-size: 1.5rem;
    color: #e11d48;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fs-pw-alert-banner-title {
    font-size: 0.94rem;
    font-weight: 800;
    color: #9f1239;
    margin-bottom: 3px;
}
.fs-pw-alert-banner-desc {
    font-size: 0.82rem;
    color: #881337;
    line-height: 1.45;
}
.fs-pw-alert-card {
    background: #ffffff;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.fs-pw-alert-card:hover {
    border-color: #fda4af;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.1);
}
.fs-pw-alert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.fs-pw-alert-product-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fs-pw-badge-expired {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fs-pw-badge-rotation {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fs-pw-expired-list {
    background: #fff5f5;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #7f1d1d;
    line-height: 1.4;
}

/* ============================================================
   WORD-LIKE PRODUCT DESCRIPTION EDITOR & RICH STYLES (TASK 1)
   ============================================================ */
.word-editor-container {
    background: #ffffff;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.word-editor-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.12);
}

.word-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: 8px;
}

.word-editor-tabs {
    display: flex;
    gap: 4px;
}

.word-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s ease;
}

.word-tab-btn:hover {
    color: var(--gray-900);
    background: var(--gray-200);
}

.word-tab-btn.active {
    color: var(--primary);
    background: #ffffff;
    border-color: var(--gray-300);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.word-editor-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.word-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.rte-btn-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rte-btn {
    width: 32px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.rte-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-300);
}

.rte-btn.active {
    background: var(--primary-bg, #f5f3ff);
    color: var(--primary);
    border-color: rgba(108, 60, 225, 0.35);
    font-weight: 700;
}

.rte-format-select {
    height: 30px;
    padding: 2px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-800);
    background: #f8fafc;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.rte-format-select:focus {
    border-color: var(--primary);
    outline: none;
}

.rte-divider {
    width: 1px;
    height: 20px;
    background: var(--gray-200);
    margin: 0 4px;
}

.rte-paste-badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.word-editor-content {
    min-height: 200px;
    max-height: 440px;
    overflow-y: auto;
    padding: 16px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--gray-800);
    background: #ffffff;
    outline: none;
    cursor: text;
    overflow-wrap: break-word;
    word-break: break-word;
}

.word-editor-content:empty:before {
    content: attr(data-placeholder);
    color: var(--gray-400);
    pointer-events: none;
    display: block;
}

.word-editor-content h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: 14px 0 6px 0;
    line-height: 1.3;
}

.word-editor-content h2:first-child {
    margin-top: 0;
}

.word-editor-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 12px 0 4px 0;
    line-height: 1.3;
}

.word-editor-content p {
    margin: 0 0 10px 0;
}

.word-editor-content ul,
.word-editor-content ol {
    margin: 6px 0 12px 0;
    padding-left: 24px;
}

.word-editor-content li {
    margin-bottom: 4px;
}

.word-editor-content a {
    color: var(--primary);
    text-decoration: underline;
}

.word-editor-content blockquote {
    border-left: 3px solid var(--primary);
    margin: 8px 0;
    padding: 6px 12px;
    background: var(--primary-bg, #f5f3ff);
    color: var(--gray-700);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

.word-editor-preview {
    min-height: 200px;
    max-height: 440px;
    overflow-y: auto;
    background: #fafafa;
    padding: 16px;
    border-top: 1px solid var(--gray-200);
}

.word-preview-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    color: #1e40af;
    font-size: 0.80rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.word-preview-body {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.word-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #f8fafc;
    border-top: 1px solid var(--gray-200);
    font-size: 0.76rem;
    color: var(--gray-500);
    flex-wrap: wrap;
    gap: 8px;
}

/* CUSTOMER PRODUCT DETAIL MODAL RICH DESCRIPTION */
.modal-product-desc-rich {
    font-size: 0.88rem;
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 14px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 6px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.modal-product-desc-rich::-webkit-scrollbar {
    width: 5px;
}

.modal-product-desc-rich::-webkit-scrollbar-track {
    background: transparent;
}

.modal-product-desc-rich::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.modal-product-desc-rich h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: 12px 0 6px 0;
    line-height: 1.35;
}

.modal-product-desc-rich h2:first-child {
    margin-top: 0;
}

.modal-product-desc-rich h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 10px 0 4px 0;
    line-height: 1.35;
}

.modal-product-desc-rich p {
    margin: 0 0 8px 0;
    line-height: 1.55;
}

.modal-product-desc-rich ul,
.modal-product-desc-rich ol {
    margin: 4px 0 10px 0;
    padding-left: 20px;
}

.modal-product-desc-rich li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.modal-product-desc-rich a {
    color: var(--primary);
    text-decoration: underline;
    transition: color 0.15s ease;
}

.modal-product-desc-rich a:hover {
    color: var(--primary-dark);
}

.modal-product-desc-rich blockquote {
    border-left: 3px solid var(--primary);
    margin: 8px 0;
    padding: 6px 12px;
    background: var(--primary-bg, #f5f3ff);
    color: var(--gray-800);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

/* ============================================================
   DEDICATED FULL PRODUCT PAGE STYLES (TASK 1 & TASK 2)
   ============================================================ */

.dedicated-product-page {
    width: 100%;
    min-height: 80vh;
    background: var(--gray-50);
    padding: 24px 0 60px 0;
    box-sizing: border-box;
}

.product-page-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Breadcrumb Navigation */
.product-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--theme-text-muted, var(--gray-500));
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.product-breadcrumb a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.product-breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--theme-text-muted, var(--gray-400));
    font-size: 0.82rem;
}

.breadcrumb-current {
    color: var(--theme-text, var(--gray-800));
    font-weight: 600;
}

/* Master Two-Column Desktop Grid Layout */
.product-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas:
        "summary  sidebar"
        "desc     sidebar"
        "faq      sidebar"
        "related  sidebar";
    gap: 28px;
    align-items: start;
    width: 100%;
}

.product-summary-block {
    grid-area: summary;
}

.product-desc-block {
    grid-area: desc;
}

.product-faq-block {
    grid-area: faq;
}

.product-related-block {
    grid-area: related;
}

.product-sidebar-block {
    grid-area: sidebar;
    position: sticky;
    top: 85px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    z-index: 10;
    box-sizing: border-box;
}

.product-sidebar-block::-webkit-scrollbar {
    width: 4px;
}

.product-sidebar-block::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

/* Mobile Single-Column Layout: Summary -> Purchase -> Description -> FAQs -> Related */
@media (max-width: 920px) {
    .product-page-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .product-summary-block { order: 1; }
    .product-sidebar-block {
        order: 2;
        position: static;
        max-height: none;
        overflow: visible;
        width: 100%;
    }
    .product-desc-block    { order: 3; }
    .product-faq-block     { order: 4; }
    .product-related-block { order: 5; }
}

/* Clean Surface Card Container */
.product-card-surface {
    background: var(--theme-card, #ffffff);
    border: 1px solid var(--theme-card-border, var(--gray-200));
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    color: var(--theme-text, var(--gray-900));
}

@media (max-width: 640px) {
    .product-card-surface {
        padding: 16px;
    }
}

/* Product Page Top Navigation & Jump to Related */
.product-page-jump-bar {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--theme-card-border, var(--gray-200));
}

.btn-jump-to-related {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-bg, rgba(79, 70, 229, 0.08));
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-jump-to-related:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.btn-jump-to-related .jump-icon-bounce {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.btn-jump-to-related:hover .jump-icon-bounce {
    transform: translateY(2px);
}

.btn-jump-to-related-sm {
    padding: 3px 9px;
    font-size: 0.74rem;
}

.product-related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-back-to-product {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--theme-text, var(--gray-800));
    background: var(--theme-card, #ffffff);
    border: 1.5px solid var(--theme-card-border, var(--gray-300));
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-back-to-product:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.btn-back-to-product-sm {
    padding: 3px 9px;
    font-size: 0.74rem;
}

/* Floating Scroll Back to Product Button */
.floating-back-to-product-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 998;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--primary);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full, 9999px);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.floating-back-to-product-btn.visible {
    display: inline-flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0);
}

.floating-back-to-product-btn:hover {
    background: var(--primary-hover, var(--primary));
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@media (max-width: 600px) {
    .floating-back-to-product-btn {
        bottom: 20px;
        left: 16px;
        padding: 8px 14px;
        font-size: 0.78rem;
    }
}

.highlight-section {
    animation: relatedHighlightPulse 1.2s ease;
}

@keyframes relatedHighlightPulse {
    0% { outline: 2px solid var(--primary); outline-offset: 4px; }
    50% { outline: 3px solid var(--primary); outline-offset: 6px; }
    100% { outline: 2px solid transparent; outline-offset: 0px; }
}

/* 1. Top Summary Block */
.product-summary-header {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

.product-summary-thumb-wrap {
    width: 130px;
    height: 130px;
    min-width: 130px;
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.product-summary-thumb-wrap img {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

.product-summary-thumb-wrap img.fit-cover {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
}

.product-summary-details {
    flex: 1;
    min-width: 0;
}

.product-badges-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.product-page-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.25;
    margin: 0 0 10px 0;
    word-break: break-word;
}

.product-page-short-desc {
    font-size: 0.95rem;
    color: var(--gray-600);
    line-height: 1.55;
    margin: 0 0 14px 0;
}

.product-page-quick-meta {
    display: flex;
    gap: 16px;
    font-size: 0.80rem;
    color: var(--gray-600);
    font-weight: 600;
    flex-wrap: wrap;
}

.product-page-quick-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

@media (max-width: 600px) {
    .product-summary-header {
        flex-direction: column;
        gap: 14px;
        align-items: center;
        text-align: center;
    }
    .product-summary-thumb-wrap {
        width: 100px;
        height: 100px;
        min-width: 100px;
    }
    .product-badges-row {
        justify-content: center;
    }
    .product-page-title {
        font-size: 1.45rem;
    }
    .product-page-quick-meta {
        justify-content: center;
        font-size: 0.76rem;
    }
}

/* 2. Purchase Panel (Sidebar) */
.product-purchase-card {
    background: var(--theme-card, #ffffff);
    border: 1.5px solid var(--theme-card-border, var(--gray-200));
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.purchase-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--theme-card-border, var(--gray-200));
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 8px;
}

.purchase-price-col {
    display: flex;
    flex-direction: column;
}

.purchase-price-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--theme-text-muted, var(--gray-500));
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.purchase-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.purchase-main-price {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.purchase-original-price {
    font-size: 0.95rem;
    color: var(--theme-text-muted, var(--gray-400));
    text-decoration: line-through;
}

.purchase-duration-pill {
    padding: 4px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 0.80rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.purchase-plans-section {
    margin-bottom: 20px;
}

.purchase-plans-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--theme-text, var(--gray-800));
    margin-bottom: 10px;
}

.purchase-plans-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-select-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--theme-card-border, var(--gray-200));
    border-radius: var(--radius-sm);
    background: var(--theme-card, #ffffff);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    color: var(--theme-text, var(--gray-900));
}

.plan-select-pill:hover {
    border-color: var(--primary);
    background: var(--theme-subtle, #faf8ff);
}

.plan-select-pill.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 2px rgba(146, 92, 22, 0.2);
}

.plan-select-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--theme-text, var(--gray-900));
    flex: 1;
    min-width: 0;
    word-break: break-word;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.plan-select-price {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.purchase-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.purchase-actions-stack .btn-lg {
    padding: 13px 18px;
    font-size: 0.96rem;
    font-weight: 700;
    justify-content: center;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.purchase-trust-box {
    padding: 14px;
    background: var(--theme-subtle, #f8fafc);
    border: 1px solid var(--theme-card-border, var(--gray-200));
    border-radius: var(--radius-sm);
    font-size: 0.80rem;
    color: var(--theme-text-muted, var(--gray-700));
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.purchase-trust-box .trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 3. Full Rich Description Block (Normal Page Scrollbar, No Fixed Height) */
.product-section-title-wrap {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--theme-card-border, var(--gray-200));
    margin-bottom: 18px;
}

.product-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--theme-text, var(--gray-900));
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-page-rich-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--theme-text, var(--gray-800));
    word-break: break-word;
    /* Strict window page scrollbar: NO max-height, NO overflow-y */
    max-height: none !important;
    overflow: visible !important;
}

.product-page-rich-desc h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--theme-text, var(--gray-900));
    margin: 22px 0 10px 0;
    line-height: 1.3;
}

.product-page-rich-desc h2:first-child {
    margin-top: 0;
}

.product-page-rich-desc h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--theme-text, var(--gray-900));
    margin: 18px 0 8px 0;
    line-height: 1.35;
}

.product-page-rich-desc p {
    margin: 0 0 12px 0;
    line-height: 1.65;
}

.product-page-rich-desc ul,
.product-page-rich-desc ol {
    margin: 8px 0 16px 0;
    padding-left: 24px;
}

.product-page-rich-desc li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.product-page-rich-desc a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.product-page-rich-desc a:hover {
    color: var(--primary-dark);
}

.product-page-rich-desc blockquote {
    border-left: 4px solid var(--primary);
    margin: 14px 0;
    padding: 10px 16px;
    background: var(--primary-bg);
    color: var(--theme-text, var(--gray-800));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

/* Responsive Description Images Scaling */
.product-page-rich-desc img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: var(--radius-sm);
    margin: 14px 0;
    display: block;
    box-shadow: var(--shadow-sm);
}

/* 4. FAQs List */
.product-page-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-faq-item {
    border: 1px solid var(--theme-card-border, var(--gray-200));
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--theme-card, #ffffff);
}

.product-faq-q {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--theme-text, var(--gray-900));
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--theme-subtle, #f8fafc);
    user-select: none;
    transition: background 0.15s ease;
}

.product-faq-q:hover {
    background: var(--theme-card-border, #f1f5f9);
}

.product-faq-a {
    padding: 14px 18px;
    font-size: 0.90rem;
    color: var(--theme-text, var(--gray-700));
    line-height: 1.65;
    border-top: 1px solid var(--theme-card-border, var(--gray-200));
    background: var(--theme-card, #ffffff);
}

/* ============================================================
   5. BRAND-MATCHED THEME SYSTEM & PALETTES
   ============================================================ */

/* Theme 1: Cream Gold (Default) */
:root, [data-theme="cream-gold"] {
    --theme-id: "cream-gold";
    --theme-bg: #FAF7EF;
    --theme-card: #FFFFFF;
    --theme-card-border: #E8E0D0;
    --theme-text: #263238;
    --theme-text-muted: #546E7A;
    --theme-primary: #925C16;
    --theme-primary-hover: #7A4B0E;
    --theme-primary-contrast: #FFFFFF;
    --theme-primary-bg: #FDF6EC;
    --theme-accent: #E9B65F;
    --theme-accent-hover: #D8A248;
    --theme-subtle: #F5EFE0;
    --theme-header-bg: #FFFFFF;
    --theme-footer-bg: #263238;
    --theme-footer-text: #FAF7EF;

    /* Override master brand tokens */
    --primary: var(--theme-primary);
    --primary-dark: var(--theme-primary-hover);
    --primary-bg: var(--theme-primary-bg);
    --accent: var(--theme-accent);
}

/* Theme 2: Clean White */
[data-theme="clean-white"] {
    --theme-id: "clean-white";
    --theme-bg: #FFFFFF;
    --theme-card: #F8FAFC;
    --theme-card-border: #E2E8F0;
    --theme-text: #263238;
    --theme-text-muted: #64748B;
    --theme-primary: #805315;
    --theme-primary-hover: #69430E;
    --theme-primary-contrast: #FFFFFF;
    --theme-primary-bg: #FDF9F0;
    --theme-accent: #D97706;
    --theme-accent-hover: #B45309;
    --theme-subtle: #F1F5F9;
    --theme-header-bg: #FFFFFF;
    --theme-footer-bg: #1E293B;
    --theme-footer-text: #F8FAFC;

    --primary: var(--theme-primary);
    --primary-dark: var(--theme-primary-hover);
    --primary-bg: var(--theme-primary-bg);
    --accent: var(--theme-accent);
}

/* Theme 3: Warm Brown */
[data-theme="warm-brown"] {
    --theme-id: "warm-brown";
    --theme-bg: #F5EFE7;
    --theme-card: #FFFCF7;
    --theme-card-border: #E7DDD0;
    --theme-text: #382A23;
    --theme-text-muted: #6A564C;
    --theme-primary: #805333;
    --theme-primary-hover: #6B4326;
    --theme-primary-contrast: #FFFFFF;
    --theme-primary-bg: #F9F2EB;
    --theme-accent: #DEB887;
    --theme-accent-hover: #CCA572;
    --theme-subtle: #EFE4D6;
    --theme-header-bg: #FFFCF7;
    --theme-footer-bg: #382A23;
    --theme-footer-text: #FFFCF7;

    --primary: var(--theme-primary);
    --primary-dark: var(--theme-primary-hover);
    --primary-bg: var(--theme-primary-bg);
    --accent: var(--theme-accent);
}

/* Theme 4: Blush Cream */
[data-theme="blush-cream"] {
    --theme-id: "blush-cream";
    --theme-bg: #FFF7F5;
    --theme-card: #FFFFFF;
    --theme-card-border: #F1DFDC;
    --theme-text: #403036;
    --theme-text-muted: #6D5B61;
    --theme-primary: #974D64;
    --theme-primary-hover: #7E3E52;
    --theme-primary-contrast: #FFFFFF;
    --theme-primary-bg: #FDF1F4;
    --theme-accent: #B84A64;
    --theme-accent-hover: #9E3851;
    --theme-gold-subtle: #D4AF37;
    --theme-subtle: #FCECE9;
    --theme-header-bg: #FFFFFF;
    --theme-footer-bg: #403036;
    --theme-footer-text: #FFF7F5;

    --primary: var(--theme-primary);
    --primary-dark: var(--theme-primary-hover);
    --primary-bg: var(--theme-primary-bg);
    --accent: var(--theme-accent);
}

/* Explicit Blush Cream high-contrast Buy Online & Accent Buttons */
[data-theme="blush-cream"] .btn-accent,
[data-theme="blush-cream"] #productPageBuyOnlineBtn,
[data-theme="blush-cream"] #modalBuyOnlineBtn,
[data-theme="blush-cream"] #proceedToPaymentBtn {
    background-color: #B84A64 !important;
    color: #FFFFFF !important;
    border: 1px solid #9E3851 !important;
    box-shadow: 0 2px 6px rgba(184, 74, 100, 0.22);
}

[data-theme="blush-cream"] .btn-accent:hover,
[data-theme="blush-cream"] #productPageBuyOnlineBtn:hover,
[data-theme="blush-cream"] #modalBuyOnlineBtn:hover,
[data-theme="blush-cream"] #proceedToPaymentBtn:hover {
    background-color: #9E3851 !important;
    color: #FFFFFF !important;
    border-color: #7E3E52 !important;
    box-shadow: 0 4px 12px rgba(184, 74, 100, 0.35);
}

/* Theme 5: Charcoal Gold */
[data-theme="charcoal-gold"] {
    --theme-id: "charcoal-gold";
    --theme-bg: #182126;
    --theme-card: #243138;
    --theme-card-border: rgba(231, 179, 90, 0.24);
    --theme-text: #F7F3E8;
    --theme-text-muted: #B4C2C9;
    --theme-primary: #E7B35A;
    --theme-primary-hover: #F2C475;
    --theme-primary-contrast: #182126; /* Dark text on gold for high accessible contrast */
    --theme-primary-bg: rgba(231, 179, 90, 0.12);
    --theme-accent: #E7B35A;
    --theme-accent-hover: #F2C475;
    --theme-subtle: #1E2B32;
    --theme-header-bg: #1F2A31;
    --theme-footer-bg: #12181C;
    --theme-footer-text: #F7F3E8;

    --primary: var(--theme-primary);
    --primary-dark: var(--theme-primary-hover);
    --primary-bg: var(--theme-primary-bg);
    --accent: var(--theme-accent);
}

/* Global Theme Base Application */
body {
    background-color: var(--theme-bg, #FAF7EF);
    color: var(--theme-text, #263238);
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Navbar & Header Theme Integration */
.header, .navbar, .top-nav {
    background-color: var(--theme-header-bg, #FFFFFF) !important;
    border-bottom-color: var(--theme-card-border, var(--gray-200)) !important;
}

.site-footer {
    background-color: var(--theme-footer-bg, #263238) !important;
    color: var(--theme-footer-text, #FAF7EF) !important;
}

/* Charcoal Gold Specialized Dark Surface Overrides */
[data-theme="charcoal-gold"] body {
    background-color: #182126 !important;
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] .header,
[data-theme="charcoal-gold"] .navbar,
[data-theme="charcoal-gold"] .admin-sidebar,
[data-theme="charcoal-gold"] .admin-header {
    background-color: #192227 !important;
    border-color: rgba(231, 179, 90, 0.22) !important;
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] .admin-content,
[data-theme="charcoal-gold"] .main-content {
    background-color: #182126 !important;
}

[data-theme="charcoal-gold"] .product-card,
[data-theme="charcoal-gold"] .product-card-surface,
[data-theme="charcoal-gold"] .product-purchase-card,
[data-theme="charcoal-gold"] .admin-card,
[data-theme="charcoal-gold"] .modal-card,
[data-theme="charcoal-gold"] .product-page-main,
[data-theme="charcoal-gold"] .product-purchase-box,
[data-theme="charcoal-gold"] .product-page-hero,
[data-theme="charcoal-gold"] .admin-table-container,
[data-theme="charcoal-gold"] .stat-card,
[data-theme="charcoal-gold"] .product-faq-item,
[data-theme="charcoal-gold"] .product-faq-a {
    background-color: #243138 !important;
    border-color: rgba(231, 179, 90, 0.22) !important;
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] .plan-select-pill {
    background-color: #1E282E !important;
    border-color: rgba(231, 179, 90, 0.25) !important;
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] .plan-select-pill:hover {
    border-color: #E7B35A !important;
    background-color: #26333B !important;
}

[data-theme="charcoal-gold"] .plan-select-pill.active {
    background-color: #2A3B44 !important;
    border-color: #E7B35A !important;
    box-shadow: 0 0 0 2px rgba(231, 179, 90, 0.3) !important;
}

[data-theme="charcoal-gold"] .plan-select-name {
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] .plan-select-price {
    color: #E7B35A !important;
}

[data-theme="charcoal-gold"] .product-summary-thumb-wrap,
[data-theme="charcoal-gold"] .purchase-trust-box {
    background-color: #1B252B !important;
    border-color: rgba(231, 179, 90, 0.2) !important;
    color: #B4C2C9 !important;
}

[data-theme="charcoal-gold"] .purchase-price-label,
[data-theme="charcoal-gold"] .purchase-original-price,
[data-theme="charcoal-gold"] .product-page-quick-meta {
    color: #8E9FA8 !important;
}

[data-theme="charcoal-gold"] .purchase-main-price {
    color: #E7B35A !important;
}

[data-theme="charcoal-gold"] .purchase-duration-pill {
    background: rgba(231, 179, 90, 0.15) !important;
    color: #E7B35A !important;
}

[data-theme="charcoal-gold"] .product-faq-q {
    background-color: #1E2B32 !important;
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] .product-faq-q:hover {
    background-color: #2B3A42 !important;
}

[data-theme="charcoal-gold"] .product-card-title,
[data-theme="charcoal-gold"] .product-page-title,
[data-theme="charcoal-gold"] h1,
[data-theme="charcoal-gold"] h2,
[data-theme="charcoal-gold"] h3,
[data-theme="charcoal-gold"] h4,
[data-theme="charcoal-gold"] strong {
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] p,
[data-theme="charcoal-gold"] .product-card-desc,
[data-theme="charcoal-gold"] .product-page-rich-desc {
    color: #D3DCE0 !important;
}

[data-theme="charcoal-gold"] input,
[data-theme="charcoal-gold"] select,
[data-theme="charcoal-gold"] textarea {
    background-color: #1B252B !important;
    border-color: #384A54 !important;
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] .btn-primary {
    background-color: #E7B35A !important;
    color: #182126 !important; /* High contrast text on gold */
    font-weight: 700 !important;
    border-color: #E7B35A !important;
}

[data-theme="charcoal-gold"] .btn-primary:hover {
    background-color: #F2C475 !important;
    color: #182126 !important;
}

/* Protect brand logo in dark theme with crisp cream backing */
[data-theme="charcoal-gold"] .logo-img,
[data-theme="charcoal-gold"] .company-logo {
    background: #FAF7EF;
    border-radius: 8px;
    padding: 3px 6px;
    box-shadow: 0 0 12px rgba(231, 179, 90, 0.35);
}

[data-theme="charcoal-gold"] .hero-banner {
    background: linear-gradient(180deg, #1f2a31 0%, #182126 100%) !important;
    border-bottom: 1px solid rgba(231, 179, 90, 0.22) !important;
}

[data-theme="charcoal-gold"] .hero-title {
    color: #F7F3E8 !important;
}

[data-theme="charcoal-gold"] .hero-subtitle {
    color: #B4C2C9 !important;
}

[data-theme="charcoal-gold"] .hero-pill {
    background: #243138 !important;
    border-color: rgba(231, 179, 90, 0.4) !important;
    color: #E7B35A !important;
}

[data-theme="charcoal-gold"] .hero-feature-item {
    color: #D3DCE0 !important;
}

[data-theme="charcoal-gold"] .category-btn {
    background: #243138 !important;
    color: #F7F3E8 !important;
    border: 1px solid rgba(231, 179, 90, 0.22) !important;
}

[data-theme="charcoal-gold"] .category-btn.active {
    background: #E7B35A !important;
    color: #182126 !important;
    font-weight: 700 !important;
    border-color: #E7B35A !important;
}

/* ============================================================
   6. RTE IMAGE UPLOADS, BUBBLE TOOLBAR & DOCUMENT-FLOW POSITIONING
   ============================================================ */

/* In-Editor and Public Page Image Resizing & Proportions */
.product-page-rich-desc img,
.product-desc-editor img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm, 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: outline 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.product-desc-editor img.rte-img-selected {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(146, 92, 22, 0.18);
}

/* Document-Flow Alignment Rules */
img[data-align="left"] {
    float: left;
    margin: 0.5rem 1.25rem 1rem 0;
    clear: left;
}

img[data-align="center"] {
    display: block;
    margin: 1.25rem auto;
    clear: both;
}

img[data-align="right"] {
    float: right;
    margin: 0.5rem 0 1rem 1.25rem;
    clear: right;
}

img[data-align="full"] {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin: 1.25rem auto;
    clear: both;
}

/* Clearfix for rich text containers so floated images never overflow */
.product-page-rich-desc::after,
.product-desc-editor::after,
.rich-text-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive collapse on mobile (prevents cramped 50px wrapping columns) */
@media (max-width: 640px) {
    img[data-align="left"],
    img[data-align="right"] {
        float: none !important;
        display: block !important;
        max-width: 100% !important;
        margin: 1rem auto !important;
        clear: both !important;
    }
}

/* Floating Image Bubble Toolbar inside Rich Text Editor */
.rte-image-bubble {
    position: absolute;
    z-index: 1050;
    background: #ffffff;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.12);
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    pointer-events: auto;
    user-select: none;
    animation: fadeInBubble 0.15s ease-out;
}

@keyframes fadeInBubble {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.rte-image-bubble .bubble-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 0.78rem;
    cursor: pointer;
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rte-image-bubble .bubble-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.rte-image-bubble .bubble-btn.active {
    background: var(--primary-bg, #fdf6ec);
    color: var(--primary, #925c16);
    border-color: var(--primary, #925c16);
    font-weight: 700;
}

.rte-image-bubble .bubble-btn.danger:hover {
    background: var(--danger-bg, #fef2f2);
    color: var(--danger, #ef4444);
}

.rte-image-bubble .bubble-sep {
    width: 1px;
    height: 18px;
    background: var(--gray-300);
    margin: 0 3px;
}

/* ============================================================
   7. APPEARANCE & THEMES ADMIN MANAGEMENT STYLES
   ============================================================ */

.theme-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.theme-preset-card {
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.theme-preset-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.09);
}

.theme-preset-card.active-theme {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(146, 92, 22, 0.25);
}

.theme-preview-box {
    height: 140px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-swatches {
    display: flex;
    gap: 8px;
    align-items: center;
}

.theme-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.theme-card-body {
    padding: 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.theme-card-meta {
    margin-bottom: 14px;
}

.theme-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-card-desc {
    font-size: 0.82rem;
    color: var(--gray-600);
    line-height: 1.45;
}

.theme-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--gray-100);
    padding-top: 12px;
}

/* ============================================================
   7. ADMIN COMPACT ORDER ENTRY, TODAY BANNER & CHANGE HISTORY
   ============================================================ */

.compact-order-box {
    transition: all 0.2s ease;
}

.today-orders-banner {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.history-timeline-entry {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-left: 3.5px solid var(--primary);
    border-radius: var(--radius-sm, 6px);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 0.81rem;
    line-height: 1.45;
}

.history-timeline-entry.created {
    border-left-color: var(--success);
}

.history-timeline-entry.completed {
    border-left-color: #0ea5e9;
}

.history-timeline-entry.edited {
    border-left-color: var(--primary);
}

.diff-list {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.diff-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.77rem;
    flex-wrap: wrap;
}

.diff-field-name {
    font-weight: 700;
    color: var(--gray-700);
    min-width: 110px;
}

.diff-pill-old {
    background: #fee2e2;
    color: #991b1b;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.74rem;
    text-decoration: line-through;
}

.diff-pill-new {
    background: #dcfce7;
    color: #166534;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.74rem;
    font-weight: 600;
}

.tag-method {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.73rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-800);
}

.tag-method-esewa {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.tag-method-khalti {
    background: #faf5ff;
    border-color: #e9d5ff;
    color: #6b21a8;
}

.tag-method-bank {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* ============================================================
   FAMILY SHARING ORDER INTEGRATION MODALS & STYLES (AGENT 2)
   ============================================================ */
.fs-host-select-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm, 6px);
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fs-host-select-option:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.fs-host-select-option.selected {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 1px var(--primary);
}

.fs-host-select-radio {
    accent-color: var(--primary);
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.fs-slot-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.fs-slot-pill.open {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.fs-slot-pill.full {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================================
   EXPIRED ORDERS PAGE & NOTIFIED BADGES
   ============================================================ */
.badge-notified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.73rem;
    font-weight: 700;
}

.badge-unnotified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.73rem;
    font-weight: 600;
}

.btn-copy-code {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 1px 4px;
    font-size: 0.75rem;
    transition: color 0.15s ease;
}

.btn-copy-code:hover {
    color: var(--primary);
}

.tag-expired {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* ============================================================
   SEARCHABLE PRODUCT SELECTOR & FAMILY AUTO-ASSIGN STYLES
   ============================================================ */
.compact-product-dropdown-menu {
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background: #ffffff;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1050;
}

.compact-product-group-title {
    padding: 6px 10px;
    font-size: 0.70rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f1f5f9;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.compact-product-option {
    padding: 8px 12px;
    font-size: 0.83rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.compact-product-option:hover,
.compact-product-option.selected {
    background: #eff6ff;
}

.compact-product-option-title {
    font-weight: 600;
    color: var(--gray-800);
}

.compact-product-option-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
}

.compact-product-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.compact-product-tag.shared {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.compact-product-tag.custom {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.compact-product-tag.out {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Expired Orders Table Enhancements - Zero Overlap & Easy Actions */
#adminExpiredOrdersNewTable {
    min-width: 760px;
    width: 100%;
}
#adminExpiredOrdersNewTable th,
#adminExpiredOrdersNewTable td {
    padding: 8px 10px;
    vertical-align: middle;
}
#adminExpiredOrdersNewTable .expired-customer-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
#adminExpiredOrdersNewTable .expired-copy-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
#adminExpiredOrdersNewTable .expired-copy-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.btn-xs.btn-outline-danger {
    color: var(--danger, #ef4444);
    border-color: var(--danger, #ef4444);
    background: transparent;
}
.btn-xs.btn-outline-danger:hover {
    color: #fff;
    background: var(--danger, #ef4444);
}
.btn-xs.btn-outline-success {
    color: var(--success, #10b981);
    border-color: var(--success, #10b981);
    background: transparent;
}
.btn-xs.btn-outline-success:hover {
    color: #fff;
    background: var(--success, #10b981);
}

/* ============================================================
   STAFF DELETION REQUESTS & 5-MIN TEMPORARY ACCESS STYLES
   ============================================================ */
@keyframes pulseDeleteGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        transform: scale(1);
    }
}

.btn-pulse {
    animation: pulseDeleteGlow 1.8s infinite !important;
}

.delete-countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #f87171;
    font-weight: 700;
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.delete-request-card {
    background: #ffffff;
    border: 1.5px solid var(--gray-200, #e2e8f0);
    border-radius: var(--radius-sm, 6px);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.delete-request-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}
.delete-request-card.pending {
    border-left: 4px solid #f59e0b;
}
.delete-request-card.approved {
    border-left: 4px solid #10b981;
}
.delete-request-card.rejected {
    border-left: 4px solid #ef4444;
}

.reason-chip {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.reason-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

.staff-perm-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--primary, #4f46e5);
    cursor: pointer;
}

/* Normal Small Alert for Expired Subscriptions */
.order-expired-small-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm, 6px);
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 0.81rem;
    color: #991b1b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.4;
}

.order-expired-small-alert i {
    color: #ef4444;
}

/* Instant Zero-Delay Authenticated User Navigation */
html.user-logged-in #guestNavButtons {
    display: none !important;
}

html.user-logged-in #userNavBadge {
    display: flex !important;
}




