/* ==================== ROOT VARIABLES ==================== */
:root {
    /* Brand Colors */
    --primary-blue: #2563eb;
    --primary-blue-light: #3b82f6;
    --primary-blue-dark: #1d4ed8;

    --accent-orange: #f97316;
    --accent-orange-light: #fb923c;
    --accent-red: #ef4444;

    --indigo: #4f46e5;
    --purple: #8b5cf6;

    /* Category Colors */
    --cat-all: #0f172a;
    --cat-laundry: #2563eb;
    --cat-dish: #059669;
    --cat-floor: #f97316;
    --cat-toilet: #e11d48;

    /* Backgrounds */
    --bg-page: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.6);
    --bg-glass-strong: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);

    /* Text Colors */
    --text-heading: #0f172a;
    --text-body: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-watermark: rgba(15, 23, 42, 0.04);

    /* Footer */
    --footer-bg: #0f172a;

    /* Product Colors */
    --product-white: #FFFFFF;
    --product-blue: #2563eb;
    --product-green: #22c55e;
    --product-red: #ef4444;
    --product-yellow: #eab308;
    --product-black: #1e293b;
    --product-orange: #f97316;

    /* Typography */
    --font-main: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-base: 115%;

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-page);
    color: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Edit Mode Body State */
body.edit-mode .product-card {
    border: 2px dashed var(--accent-orange);
}

body.edit-mode .editable:hover {
    background: rgba(249, 115, 22, 0.1);
    cursor: text;
}

body.edit-mode .edit-only {
    display: flex !important;
}

body.edit-mode .drag-handle {
    display: flex !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== ANIMATED BACKGROUND ORBS ==================== */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-blue {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.4), transparent 70%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-orange {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.35), transparent 70%);
    top: 30%;
    right: -100px;
    animation-delay: -7s;
}

.orb-purple {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3), transparent 70%);
    bottom: -150px;
    left: 30%;
    animation-delay: -14s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -50px) scale(1.05);
    }

    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }

    75% {
        transform: translate(40px, 40px) scale(1.02);
    }
}

/* ==================== FLOATING CONTROL BAR ==================== */
.floating-control-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    box-shadow: var(--glass-shadow);
    z-index: 1000;
}

.mode-switch {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: var(--radius-full);
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
}

.mode-btn.active {
    background: white;
    color: var(--text-heading);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mode-btn[data-mode="edit"].active {
    background: var(--accent-orange);
    color: white;
}

.mode-btn:hover:not(.active) {
    color: var(--text-heading);
}

.divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
}

.excel-tools {
    display: flex;
    gap: 8px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.tool-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

.btn-get-code {
    padding: 10px 20px;
    background: var(--cat-all);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-get-code:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    padding: 120px 5% 80px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.catalogue-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent-orange);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.ping {
    width: 10px;
    height: 10px;
    background: var(--accent-orange);
    border-radius: 50%;
    position: relative;
}

.ping::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--accent-orange);
    border-radius: 50%;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {

    75%,
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.1;
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-blue), var(--indigo), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    padding: 0 5% 120px;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 12px 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    width: fit-content;
}

.section-bar {
    width: 4px;
    height: 24px;
    border-radius: 2px;
}

.section-bar.laundry {
    background: var(--cat-laundry);
}

.section-bar.dish {
    background: var(--cat-dish);
}

.section-bar.floor {
    background: var(--cat-floor);
}

.section-bar.toilet {
    background: var(--cat-toilet);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent);
    min-width: 100px;
}

/* Product Grid - Centered */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    justify-items: center;
}

/* Product Section */
.product-section {
    max-width: 1400px;
    margin: 0 auto 40px;
}

/* ==================== PRODUCT CARD ==================== */
.product-card {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition);
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.product-card:hover {
    /* 1. Hiệu ứng Nổi lên (Levitation) */
    transform: translateY(-8px);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(37, 99, 235, 0.1);

    /* Nền đục hơn và viền xanh */
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(59, 130, 246, 0.4);
}

.product-card.dragging {
    opacity: 0.5;
    transform: scale(1.02);
}

/* Watermark ID - Chữ chìm phía sau */
.product-card::before {
    content: attr(data-watermark);
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 6rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.04);
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    user-select: none;
}

/* Drag Handle */
.drag-handle {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 10;
    color: var(--text-muted);
    transition: all var(--transition);
}

.drag-handle:hover {
    background: var(--primary-blue);
    color: white;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Delete Button */
.btn-delete-card {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--accent-red);
    border: none;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: white;
    transition: all var(--transition);
}

.btn-delete-card:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

/* Image Section */
.card-image-section {
    position: relative;
    padding: 6px;
    aspect-ratio: 2/1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    z-index: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Hiệu ứng hào quang phóng to khi hover */
.product-card:hover .image-glow {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.6;
}

.image-glow.laundry {
    background: var(--cat-laundry);
}

.image-glow.dish {
    background: var(--cat-dish);
}

.image-glow.floor {
    background: var(--cat-floor);
}

.image-glow.toilet {
    background: var(--cat-toilet);
}

.product-image {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

/* 2. Hiệu ứng phóng to ảnh 10% khi hover */
.product-card:hover .product-image {
    transform: scale(1.10);
}

.category-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: white;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

body.edit-mode .category-tag {
    left: 50px;
}

.btn-zoom {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition);
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 2. Hiệu ứng nút zoom xuất hiện khi hover */
.product-card:hover .btn-zoom {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-zoom:hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Upload Image Button (Edit Mode) */
.btn-upload-image {
    display: none;
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 6px 10px;
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
    gap: 6px;
    transition: all var(--transition);
}

.btn-upload-image:hover {
    background: var(--accent-orange-light);
}

/* Card Body */
.card-body {
    padding: 8px 12px;
    position: relative;
    z-index: 1;
}

.product-code {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 2px;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}

/* 3. Hiệu ứng văn bản - tiêu đề chuyển xanh khi hover */
.product-card:hover .product-code {
    color: var(--primary-blue);
}

.product-price {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.product-price span {
    position: relative;
    padding: 4px;
    border-radius: var(--radius-sm);
}

/* Đường kẻ gradient - ban đầu 48px */
.product-price span::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 4px;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-red));
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Đường kẻ mở rộng toàn chiều rộng khi hover */
.product-card:hover .product-price span::after {
    width: calc(100% - 8px);
}

/* Expand Button */
.btn-expand {
    width: 100%;
    padding: 6px;
    background: rgba(37, 99, 235, 0.08);
    border: none;
    border-radius: var(--radius-md);
    color: var(--primary-blue);
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-expand:hover {
    background: rgba(37, 99, 235, 0.15);
}

.btn-expand i {
    transition: transform var(--transition);
}

.product-card.expanded .btn-expand i {
    transform: rotate(180deg);
}

/* Expandable Details */
.card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.product-card.expanded .card-details {
    max-height: 800px;
}

.details-content {
    padding: 8px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Color Options */
.color-section {
    margin-bottom: 6px;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.color-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.color-swatch.white {
    background: var(--product-white);
    border: 2px solid #e2e8f0;
}

.color-swatch.transparent {
    background: repeating-conic-gradient(#e2e8f0 0% 25%, white 0% 50%) 50% / 8px 8px;
    border: 2px solid #e2e8f0;
}

.color-swatch.blue {
    background: var(--product-blue);
}

.color-swatch.green {
    background: var(--product-green);
}

.color-swatch.red {
    background: var(--product-red);
}

.color-swatch.yellow {
    background: var(--product-yellow);
}

.color-swatch.black {
    background: var(--product-black);
}

.color-swatch.orange {
    background: var(--product-orange);
}

/* Custom color swatches - styled via inline */
.color-swatch[data-hex] {
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* Delete color button */
.color-swatch .delete-color {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: var(--accent-red);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

body.edit-mode .color-swatch:hover .delete-color {
    display: flex;
}

/* Add color button */
.btn-add-color {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 2px dashed rgba(0, 0, 0, 0.2);
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    transition: all var(--transition);
}

body.edit-mode .btn-add-color {
    display: flex;
}

.btn-add-color:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Specs Grid */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.spec-tile {
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.spec-tile:hover {
    background: white;
    transform: translateY(-2px);
}

/* 4. Hiệu ứng ô thông tin sáng hơn khi hover card */
.product-card:hover .spec-tile {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.2);
}

.spec-icon {
    font-size: 0.7rem;
    color: var(--primary-blue);
    margin-bottom: 2px;
}

.spec-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.spec-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-heading);
    padding: 1px 2px;
    border-radius: var(--radius-sm);
    line-height: 1.3;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 8px;
}

.btn-download {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, var(--cat-all), #1e293b);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3);
}

.btn-3d {
    padding: 10px 16px;
    background: white;
    color: var(--accent-orange);
    border: 2px solid var(--accent-orange);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-3d:hover {
    background: var(--accent-orange);
    color: white;
}

/* Add Product Container */
.add-product-container {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.btn-add-product {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-blue), var(--indigo));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

.btn-add-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.4);
}

/* Add Product Card for each category */
.add-card-container {
    display: none;
    width: 100%;
    max-width: 340px;
}

body.edit-mode .add-card-container {
    display: block;
}

.add-product-card {
    width: 100%;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-main);
}

.add-product-card:hover {
    border-color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.05);
}

.add-card-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all var(--transition);
}

.add-product-card:hover .add-card-icon {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

.add-product-card span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
}

.add-product-card:hover span {
    color: var(--primary-blue);
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.nav-container {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.nav-item {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all var(--transition);
    white-space: nowrap;
    min-width: 60px;
}

.nav-item span {
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-heading);
}

.nav-item.active {
    background: var(--cat-all);
    color: white;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
}

.nav-item[data-cat="laundry"].active {
    background: var(--cat-laundry);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.nav-item[data-cat="dish"].active {
    background: var(--cat-dish);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.nav-item[data-cat="floor"].active {
    background: var(--cat-floor);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.nav-item[data-cat="toilet"].active {
    background: var(--cat-toilet);
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
}

.nav-item i {
    font-size: 1.1rem;
}

/* Navigation Groups */
.nav-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-divider {
    width: 1px;
    height: 28px;
    background: rgba(0, 0, 0, 0.15);
    margin: 0 8px;
}

/* Volume Filters */
.volume-filters {
    display: flex;
    gap: 4px;
}

.nav-item-sm {
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.nav-item-sm:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-heading);
}

.nav-item-sm.active {
    background: var(--primary-blue);
    color: white;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--footer-bg);
    padding: 60px 5% 30px;
    margin-bottom: 80px;
    position: relative;
    overflow: hidden;
}

.footer-orbs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.footer-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.footer-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-blue);
    top: -200px;
    left: -100px;
}

.footer-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-orange);
    bottom: -150px;
    right: -50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-col h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-blue), var(--indigo));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.footer-slogan {
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-contact {
    list-style: none;
}

.footer-contact li {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-contact i {
    color: var(--primary-blue-light);
    margin-top: 4px;
}

/* CTA Card */
.cta-card {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-blue), var(--indigo));
    border-radius: var(--radius-lg);
    color: white;
}

.cta-card h4 {
    margin-bottom: 10px;
}

.cta-card p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.btn-cta {
    width: 100%;
    padding: 12px;
    background: white;
    color: var(--primary-blue);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.footer-bottom p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 10;
}

.close-modal:hover {
    background: white;
    color: var(--text-heading);
    transform: rotate(90deg);
}

/* Zoom Modal */
.zoom-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.zoom-content img {
    max-width: 100%;
    max-height: 85vh;
    border: 8px solid white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Video Modal */
.video-content {
    position: relative;
    width: 90%;
    max-width: 900px;
}

#video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: black;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#video-container iframe,
#video-container video {
    width: 100%;
    height: 100%;
}

#video-container.portrait {
    aspect-ratio: 9/16;
    max-height: 80vh;
    width: auto;
    margin: 0 auto;
}

.btn-fullscreen {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-fullscreen:hover {
    background: white;
    color: var(--text-heading);
}

/* HTML Modal */
.html-content {
    position: relative;
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.html-content .close-modal {
    background: var(--bg-page);
    color: var(--text-muted);
}

.html-content h3 {
    font-size: 1.4rem;
    color: var(--text-heading);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.html-description {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.code-block {
    background: #1e293b;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.code-block pre {
    color: #a5f3fc;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-copy,
.btn-download-html {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition);
}

.btn-copy {
    background: var(--primary-blue);
    color: white;
}

.btn-copy:hover {
    background: var(--primary-blue-dark);
}

.btn-download-html {
    background: var(--cat-all);
    color: white;
}

.btn-download-html:hover {
    background: #1e293b;
}

/* Delete Modal */
.delete-content {
    position: relative;
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.delete-icon {
    width: 64px;
    height: 64px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent-red);
    font-size: 1.5rem;
}

.delete-content h3 {
    font-size: 1.3rem;
    color: var(--text-heading);
    margin-bottom: 10px;
}

.delete-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.delete-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel,
.btn-confirm-delete {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-cancel {
    background: var(--bg-page);
    color: var(--text-muted);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-confirm-delete {
    background: var(--accent-red);
    color: white;
    border: none;
}

.btn-confirm-delete:hover {
    background: #dc2626;
}

/* Add Product Modal */
.add-content {
    position: relative;
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.add-content .close-modal {
    background: var(--bg-page);
    color: var(--text-muted);
}

.add-content h3 {
    font-size: 1.3rem;
    color: var(--text-heading);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
}

.form-group.full-width {
    width: 100%;
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-heading);
    transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-blue), var(--indigo));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    transition: all var(--transition);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* Color Picker Modal */
.color-content {
    position: relative;
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    max-width: 400px;
    width: 90%;
}

.color-content .close-modal {
    background: var(--bg-page);
    color: var(--text-muted);
}

.color-content h3 {
    font-size: 1.2rem;
    color: var(--text-heading);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.palette-color {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
}

.palette-color:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hex-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.hex-row {
    display: flex;
    gap: 8px;
}

.hex-row input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.hex-row input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

#btn-add-hex {
    width: 48px;
    height: 48px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

#btn-add-hex:hover {
    background: var(--primary-blue-dark);
}

/* Color Section Label */
.color-section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    margin-top: 16px;
}

.color-section-label:first-of-type {
    margin-top: 0;
}

/* Color Wheel */
.color-wheel-group {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-page);
    border-radius: var(--radius-md);
}

.color-wheel-input {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-wheel-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-wheel-input::-webkit-color-swatch {
    border-radius: var(--radius-md);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.color-wheel-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: #2563eb;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.btn-add-wheel-color {
    flex: 1;
    padding: 12px 16px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

.btn-add-wheel-color:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .floating-control-bar {
        padding: 6px 12px;
        gap: 8px;
    }

    .mode-btn span {
        display: none;
    }

    .btn-get-code span {
        display: none;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 100%;
    }

    .floating-control-bar {
        top: 10px;
        right: 10px;
        padding: 4px 8px;
    }

    .excel-tools {
        display: none;
    }

    .divider {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 24px;
        /* Explicit column gap */
        row-gap: 24px;
    }

    /* Mobile Nav - Keep icons and text */
    .nav-item {
        padding: 8px 10px;
        min-width: 50px;
    }

    .nav-item i {
        font-size: 1rem;
    }

    .nav-item span {
        font-size: 0.6rem;
        display: block;
    }

    /* Hide volume filters on mobile */
    .nav-divider {
        display: none;
    }

    .volume-filters {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cta-card {
        margin-top: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .modal-actions {
        flex-direction: column;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    /* Watermark badge smaller on mobile */
    .product-card::before {
        font-size: 1rem;
        padding: 6px 10px;
        top: 12px;
        right: 12px;
    }
}

/* Edit Links in Product Card */
.edit-links {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
    width: 100%;
}

body.edit-mode .product-card .edit-links {
    display: flex;
}

.edit-links .input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-links label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-links input {
    width: 100%;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #334155;
    transition: all 0.2s ease;
}

.edit-links input:focus {
    outline: none;
    background: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-links input::placeholder {
    color: #cbd5e1;
}

@media (max-width: 768px) {

    /* Optimize Product Card Height (~40% reduction) */
    .product-grid {
        gap: 12px;
        /* Reduced gap */
    }

    .card-image-section {
        aspect-ratio: 4/3;
        /* Changed from 1/1 to 4/3 to reduce height */
        padding: 0;
    }

    .image-glow {
        width: 100px;
        height: 100px;
        filter: blur(30px);
    }

    .product-image {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
        transform: scale(1.05);
        /* Slight zoom */
    }

    .card-body {
        padding: 6px 8px;
        /* Tighter padding */
    }

    .product-code {
        font-size: 0.65rem;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }

    .product-price {
        font-size: 0.6rem;
        margin-bottom: 4px;
        display: none;
        /* Hide price on mobile to save space if needed, or keep small */
        /* display: block; -- Re-enabling for now but small */
    }

    .product-price .editable {
        display: block;
        /* Ensure visibility */
    }

    .btn-expand {
        padding: 2px 0;
        font-size: 0.6rem;
        width: 100%;
        justify-content: center;
        background: transparent;
        color: #64748b;
        border: 1px solid #f1f5f9;
        margin-top: 2px;
    }

    .btn-expand span {
        display: none;
        /* Hide text "Xem chi tiết", show only icon */
    }

    .btn-expand i {
        font-size: 0.8rem;
    }

    .btn-expand:hover {
        background: #f8fafc;
        transform: none;
    }

    .category-tag {
        padding: 2px 6px;
        font-size: 0.5rem;
        top: 4px;
        left: 4px;
        backdrop-filter: blur(4px);
    }

    .product-card::before {
        font-size: 0.7rem;
        padding: 4px 8px;
        top: 4px;
        right: 4px;
    }

    /* Hide Specs Grid on Mobile Initially - Show when expanded */
    .specs-grid {
        display: none;
    }

    .product-card.expanded .specs-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px 0;
    }

    .product-card.expanded .spec-tile {
        padding: 8px;
        font-size: 0.75rem;
    }

    .product-card.expanded .spec-label {
        font-size: 0.65rem;
    }

    .product-card.expanded .spec-value {
        font-size: 0.8rem;
    }

    /* Ensure actions are compact */
    .card-actions {
        gap: 4px;
    }

    .card-actions button {
        padding: 6px;
        font-size: 0.7rem;
    }
}