:root {
    --primary: #1435c3; /* PhongVu Deep Blue */
    --primary-hover: #0c238b;
    --secondary: #475569;
    --danger: #ef4444; /* Price red */
    --bg-color: #f4f6f8;
    --surface: #ffffff;
    --text-main: #333333;
    --text-muted: #82869e;
    --border: #e4e5f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: 14px;
}

/* Header & Nav */
.top-header {
    background-color: var(--primary);
    color: white;
    padding: 12px 0;
}
.search-bar {
    border-radius: 8px 0 0 8px;
    border: none;
    padding: 12px 20px;
    width: 100%;
    outline: none;
    font-size: 14px;
}
.search-bar:focus {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}
.search-btn {
    background: white;
    color: var(--text-main);
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0 24px;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
}
.search-btn:hover {
    color: var(--primary);
}
.header-icon {
    font-size: 24px;
    color: white;
    position: relative;
}
.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--danger);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
}
.main-nav {
    background-color: white;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
}
.nav-link-custom {
    color: var(--text-main);
    font-weight: 500;
    padding: 12px 16px;
    text-decoration: none;
    display: inline-block;
}
.nav-link-custom:hover {
    color: var(--primary);
}
.category-btn {
    background: #f97316;
    color: white;
    padding: 12px 10px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
    display: inline-block;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.category-btn:hover {
    background: #ea580c;
    color: white;
}

/* Layout Helpers */
.container-pv {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
.bg-surface {
    background-color: var(--surface);
    border-radius: 4px;
}

/* Product Cards */
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}
.product-img-wrap {
    padding: 10px;
    text-align: center;
}
.product-img {
    height: 180px;
    object-fit: contain;
}
.product-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-title {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.product-price {
    color: var(--danger);
    font-weight: 700;
    font-size: 16px;
    margin-top: auto;
}
.product-old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 8px;
}

/* Left Menu Sidebar */
.sidebar-menu {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
}
.sidebar-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    display: block;
    text-decoration: none;
    font-weight: 500;
}
.sidebar-item:hover {
    color: var(--primary);
    background: #f8fafc;
}

/* Buttons */
.btn-pv {
    background-color: var(--danger);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    transition: 0.2s;
}
.btn-pv:hover {
    background-color: #dc2626;
    color: white;
}
.btn-outline-pv {
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 600;
    background: white;
}
.btn-outline-pv:hover {
    background: var(--primary);
    color: white;
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 40px 0 20px 0;
    margin-top: 40px;
}
.footer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-main);
}
.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}
.footer-link:hover {
    color: var(--primary);
}

/* Floating Action Buttons */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 1000;
}
.floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    position: relative;
}
.floating-btn:hover {
    transform: scale(1.15);
    color: white;
}

/* Call Button Animations */
.btn-call {
    background-color: #28a745;
}
.btn-call::before,
.btn-call::after {
    content: '';
    position: absolute;
    border: 1px solid #28a745;
    left: -10px;
    right: -10px;
    top: -10px;
    bottom: -10px;
    border-radius: 50%;
    animation: layout-pulse 1.8s linear infinite;
    opacity: 0;
}
.btn-call::after {
    animation-delay: 0.6s;
}
.btn-call i {
    animation: phone-shake 1s infinite alternate;
}

/* Zalo Button Animations */
.btn-zalo {
    background-color: #0068ff;
}
.btn-zalo::before,
.btn-zalo::after {
    content: '';
    position: absolute;
    border: 1px solid #0068ff;
    left: -10px;
    right: -10px;
    top: -10px;
    bottom: -10px;
    border-radius: 50%;
    animation: layout-pulse 1.8s linear infinite;
    opacity: 0;
}
.btn-zalo::after {
    animation-delay: 0.6s;
}
.btn-zalo .zalo-icon-text {
    font-weight: 700;
    font-family: Arial, sans-serif;
    font-size: 16px;
    margin-top: 2px;
    animation: phone-shake 1.2s infinite alternate;
    display: inline-block;
}

/* Slide-out Text labels on hover */
.floating-btn-label {
    position: absolute;
    right: 70px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.floating-btn:hover .floating-btn-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

@keyframes layout-pulse {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes phone-shake {
    0% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    100% { transform: rotate(-15deg); }
}

/* Autocomplete */
.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    border: 1px solid var(--border);
}
.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
    transition: background-color 0.2s;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item:hover {
    background-color: #f8fafc;
    color: var(--text-main);
}
.autocomplete-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 15px;
}
.autocomplete-info {
    flex-grow: 1;
}
.autocomplete-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.autocomplete-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--danger);
}
.autocomplete-empty {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Responsive Auto-fit Images for News Content */
.news-content img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 6px;
}

/* Scroll Gallery for Detail Sub-images */
.scroll-gallery::-webkit-scrollbar {
    height: 5px;
}
.scroll-gallery::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.scroll-gallery::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.scroll-gallery::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Gallery Nav Buttons (< >) on Main Image Box */
.btn-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.75;
    z-index: 10;
}

.gallery-main-box:hover .btn-gallery-nav {
    opacity: 1;
}

.btn-gallery-nav:hover {
    background: rgba(20, 53, 195, 0.9);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    left: 10px;
}

.nav-next {
    right: 10px;
}

/* Premium Modern Quantity Selector */
.qty-picker {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}

.qty-picker:hover {
    border-color: #94a3b8;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.15s ease-in-out;
}

.qty-btn:hover {
    background: #1435c3;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(20, 53, 195, 0.25);
    transform: scale(1.04);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    width: 48px;
    height: 36px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    outline: none !important;
    box-shadow: none !important;
    padding: 0;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
