/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- COLOR PALETTE & VARIABLES --- */
:root {
    --primary-color: #00a8ff;
    --main-color: #00a8ff;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #f1f1f1;
    --secondary-text-color: #a0a0a0;
    --danger-color: #ff4757;
    --border-color: #333;
    --box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    --border-radius: 12px;
    --border-radius-small: 8px;
    --border-radius-large: 18px;
    --card-bg-color: #232323;
    --primary-text-color: #f1f1f1;
    --white: #fff;
}

/* --- BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    border: none;
    outline: none;
    transition: all .2s linear;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    font-size: 100%;
}

body {
    background: var(--background-color);
    color: var(--text-color);
    min-width: 0;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

section {
    padding: 4rem 7%;
}

.hidden {
    display: none !important;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}
.btn:hover {
    background: #007bbd;
    transform: scale(1.05);
}
.btn:disabled,
.btn[disabled] {
    background: #555 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    border-color: #555 !important;
}

/* --- HEADER --- */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 7%;
    background: var(--surface-color);
    box-shadow: var(--box-shadow);
    z-index: 1000;
    width: 100vw;
    min-width: 0;
}

.header .logo {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.header .logo .logo-icon {
    height: 1.7rem;
    margin-right: 0.5rem;
}

.header .navbar {
    margin: 0 1rem;
    display: flex;
    gap: 1rem;
}
.header .navbar a {
    font-size: 1rem;
    color: var(--secondary-text-color);
    font-weight: 500;
    margin: 0 1rem;
}
.header .navbar a:hover,
.header .navbar a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.header .icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.header .icons i {
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--secondary-text-color);
    padding: 5px;
}
.header .icons i:hover {
    color: var(--primary-color);
}
#menu-btn {
    display: none;
}

/* --- PROFILE PICTURE --- */
#profile-link {
    display: block;
    height: 38px;
    width: 38px;
    cursor: pointer;
    padding: 5px;
    box-sizing: content-box;
}
#header-profile-img {
    height: 100%;
    width: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary-text-color);
    transition: border-color 0.2s;
}
#profile-link:hover #header-profile-img {
    border-color: var(--primary-color);
}

/* --- CART ICON --- */
.cart-icon-container {
    position: relative;
    cursor: pointer;
}
#cart-item-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: transform 0.2s ease;
}

/* --- SEARCH FORM --- */
.search-form {
    position: fixed;
    top: -100%;
    left: 0; right: 0;
    padding: 1rem 7%;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    z-index: 1001;
    gap: 1rem;
    width: 100vw;
}
.search-form.active {
    top: 5rem;
    box-shadow: var(--box-shadow);
}
.search-form input {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    color: var(--text-color);
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}
.search-form label {
    font-size: 1.4rem;
    color: var(--secondary-text-color);
    cursor: pointer;
}
.search-form label:hover {
    color: var(--primary-color);
}

/* --- HOME SECTION --- */
.home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: background-image 1s ease-in-out;
}
.home .content h1 { font-size: 3.5rem; color: var(--text-color); }
.home .content p { font-size: 1.2rem; margin: 1rem 0 2rem; color: var(--secondary-text-color); }

/* --- CATEGORY GRID --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.category-item {
    background: var(--surface-color);
    padding: 2rem;
    text-align: center;
    border-radius: var(--border-radius);
    cursor: pointer;
}
.category-item:hover {
    transform: translateY(-10px);
    background: var(--primary-color);
}
.category-item i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.category-item:hover i, .category-item:hover h3 {
    color: var(--text-color);
}
.category-item h3 { font-size: 1.2rem; }

/* --- PRODUCT GRID --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.product-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.5s ease-in-out, box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
}
.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 168, 255, 0.15);
}
.product-image {
    position: relative;
    width: 100%;
    height: 250px;
    background: linear-gradient(110deg, #2a2a2a 8%, #383838 18%, #2a2a2a 33%);
    background-size: 200% 100%;
    animation: 1.5s shimmer infinite;
    cursor: pointer;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}
@keyframes shimmer { to { background-position-x: -200%; } }
@keyframes fadeIn { to { opacity: 1; } }

.product-discount {
    position: absolute;
    top: 15px; left: 15px;
    background: var(--danger-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 2;
}
.product-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.status-in-stock { background-color: rgba(46, 204, 113, 0.8); }
.status-sold-out { background-color: rgba(231, 76, 60, 0.8); }
.product-card.sold-out .product-image img { filter: grayscale(100%); }
.product-card.sold-out .product-image::after {
    content: 'SOLD OUT';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    z-index: 1;
    cursor: default;
}
.product-info { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.product-name { font-size: 1.2rem; color: var(--text-color); }
.product-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}
.product-id,
.product-date {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    background-color: #2a2a2a;
    padding: 3px 8px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.product-id { font-family: 'Courier New', Courier, monospace; }
.product-caption { font-size: 0.9rem; color: var(--secondary-text-color); margin: 0.5rem 0 1rem; flex-grow: 1; }
.product-price-container { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 1rem; }
.product-price { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.product-old-price { font-size: 1rem; color: var(--secondary-text-color); text-decoration: line-through; }
.product-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.quantity-control { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: 5px; }
.quantity-btn, .quantity-input { background: none; color: var(--text-color); width: 40px; height: 40px; font-size: 1.2rem; text-align: center; }
.quantity-input { width: 50px; border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.quantity-btn { cursor: pointer; }
.action-btn.favorite-btn { font-size: 1.5rem; color: var(--secondary-text-color); cursor: pointer; }
.action-btn.favorite-btn.active { color: var(--danger-color); }
.order-buttons { display: flex; gap: 1rem; }
.add-to-cart-btn { background: var(--surface-color); color: var(--text-color); border: 1px solid var(--border-color); flex-grow: 1; }
.add-to-cart-btn:hover { background: #333; }
.order-now-btn { background: var(--primary-color); color: var(--text-color); flex-grow: 1; }
.order-now-btn:hover { background: #007bbd; }

/* --- SHOPPING CART --- */
.shopping-cart {
    position: fixed;
    top: 0;
    right: -100%;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: var(--surface-color);
    box-shadow: var(--box-shadow);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}
.shopping-cart.active { right: 0; }
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.cart-header h3 { font-size: 1.5rem; }
.cart-header #close-cart-btn { font-size: 1.5rem; cursor: pointer; }
.cart-header #close-cart-btn:hover { color: var(--danger-color); }
.cart-items-container {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
}
.cart-empty-message {
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 1.1rem;
    margin-top: 5rem;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}
.cart-item-info { flex-grow: 1; }
.cart-item-info h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.cart-item-info .cart-item-price { font-size: 0.9rem; color: var(--secondary-text-color); }
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.cart-item-actions .quantity-control { transform: scale(0.8); }
.cart-item-actions .cart-remove-btn {
    font-size: 1.2rem;
    color: var(--secondary-text-color);
    cursor: pointer;
}
.cart-item-actions .cart-remove-btn:hover { color: var(--danger-color); }
.cart-footer {
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    padding: 1.5rem 1.5rem calc(3rem + env(safe-area-inset-bottom)) 1.5rem;
}
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.cart-total span:last-child {
    font-size: 1.5rem;
    color: var(--primary-color);
}
.order-all-btn { width: 100%; }

/* --- PROMO BANNER --- */
.promo-banner {
    background: linear-gradient(45deg, var(--primary-color), #007bbd);
    padding: 3rem;
    text-align: center;
    border-radius: var(--border-radius);
}
.promo-banner h3 { font-size: 2rem; margin-bottom: 1rem; }
.promo-banner .btn { background: var(--text-color); color: var(--primary-color); }

/* --- FOOTER --- */
.footer {
    background: var(--surface-color);
    padding: 4rem 7% 2rem;
}
.footer-content-wrapper {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    align-items: flex-start;
}
.contact-form-container, .contact-info {
    flex: 1 1 400px;
}
.contact-form-container h3, .contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}
#contact-form .form-group {
    margin-bottom: 1rem;
}
#contact-form input, #contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}
#contact-form textarea {
    resize: vertical;
    min-height: 120px;
}
#contact-form .btn { width: 100%; }
.contact-info p {
    font-size: 1rem;
    color: var(--secondary-text-color);
    margin-bottom: 1.5rem;
}
.footer .social-links {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    flex-wrap: wrap;
    padding-top: 1rem;
}
.footer .social-item {
    text-align: center;
    width: 150px;
}
.footer .social-links a {
    display: inline-block;
    color: var(--secondary-text-color);
    background: var(--background-color);
    font-size: 1.5rem;
    height: 50px;
    width: 50px;
    line-height: 50px;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}
.footer .social-links a:hover {
    color: var(--text-color);
    background: var(--primary-color);
    transform: translateY(-5px);
}
.footer .social-item .social-name {
    font-size: 1rem;
    color: var(--text-color);
    word-wrap: break-word;
}
.footer .copyright {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--secondary-text-color);
    text-align: center;
}

/* --- AUTH MODAL --- */
.auth-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1003;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.auth-modal {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--box-shadow);
}
.close-auth-btn {
    position: absolute;
    top: 10px; right: 20px;
    font-size: 2.5rem;
    color: var(--secondary-text-color);
    cursor: pointer;
}
.close-auth-btn:hover { color: var(--text-color); }
.auth-modal h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}
.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    color: var(--text-color);
    font-size: 1rem;
}
.auth-modal .btn {
    width: 100%;
    margin-top: 1rem;
}
.form-switcher {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--secondary-text-color);
}
.form-switcher a {
    color: var(--primary-color);
    font-weight: 600;
}
.form-link-right {
    text-align: right;
    font-size: 0.9rem;
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
}
.form-link-right a {
    color: var(--secondary-text-color);
    text-decoration: none;
}
.form-link-right a:hover {
    color: var(--primary-color);
}
.form-intro {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* --- IMAGE PREVIEW --- */
.image-preview-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1004;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 1rem;
    cursor: pointer;
}
#preview-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}
#preview-caption {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-top: 1rem;
    font-weight: 500;
}
.close-preview-btn {
    position: absolute;
    top: 20px; right: 30px;
    font-size: 3rem;
    color: var(--secondary-text-color);
    cursor: pointer;
    line-height: 1;
}
.close-preview-btn:hover {
    color: var(--text-color);
}

/* --- ANTI-INSPECT MODAL --- */
.anti-inspect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
.anti-inspect-overlay.active {
    display: flex;
}
.modal-content {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--secondary-text-color);
    cursor: pointer;
    line-height: 1;
}
.close-modal-btn:hover {
    color: var(--text-color);
}
.modal-social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.modal-social-links .social-item {
    text-align: center;
    width: 150px;
}
.modal-social-links .social-item a {
    display: inline-block;
    color: var(--secondary-text-color);
    background: var(--background-color);
    font-size: 1.8rem;
    height: 60px;
    width: 60px;
    line-height: 60px;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}
.modal-social-links .social-item a:hover {
    color: var(--text-color);
    background: var(--primary-color);
    transform: translateY(-5px);
}
.modal-social-links .social-item .social-name {
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0;
}

/* --- AD BANNER --- */
.ad-banner-container {
    padding-top: 7rem;
    padding-bottom: 2rem;
    width: 100vw;
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background-color);
    overflow: hidden;
}

/* --- PROMOTION SECTION --- */
.promotion .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 2rem;
}
.promotion-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.promotion-card-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.promotion-card {
    background: var(--card-bg-color);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    text-align: center;
}
.promotion-card .product-image {
    width: 100%;
    height: 20rem;
    object-fit: cover;
    border-radius: var(--border-radius-small);
    margin-bottom: 1.5rem;
}
.promotion-card h3 {
    font-size: 1.8rem;
    color: var(--primary-text-color);
    margin-bottom: 1rem;
    flex-grow: 1;
}
.promotion-card .price-info {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.promotion-card .product-price {
    font-size: 2.2rem;
    color: var(--main-color);
    font-weight: bold;
}
.promotion-card .product-old-price {
    font-size: 1.6rem;
    color: var(--secondary-text-color);
    text-decoration: line-through;
}
.countdown-timer {
    background: var(--main-color);
    color: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius-small);
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 1px;
}

/* --- PRODUCT HIGHLIGHT --- */
.product-card.highlighted-product {
    background-color: rgba(0, 150, 255, 0.15);
    box-shadow: 0 0 25px 8px var(--main-color);
    transform: scale(1.03);
    z-index: 10;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* Tablets (max-width: 991px) */
@media (max-width: 991px) {
    html { font-size: 90%; }
    .header { padding: 1.5rem 2rem; }
    section { padding: 4rem 2rem; }
    #menu-btn { display: inline-block; }
    .header .navbar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--surface-color);
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
        z-index: 1001;
    }
    .header .navbar.active {
        right: 0;
        display: flex;
    }
    .header .navbar a {
        font-size: 1.5rem;
        display: block;
    }
    .search-form.active { top: 6.2rem; }
    .footer-content-wrapper { flex-direction: column; gap: 2rem; }
    .product-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .category-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .shopping-cart { width: 90vw; }
}

/* Large Phones & Small Tablets (max-width: 727px) */
@media (max-width: 727px) {
    html { font-size: 85%; }
    .ad-banner-container {
        min-height: 50px;
        padding-top: 6.5rem;
        padding-bottom: 1rem;
    }
    .ad-banner-container iframe {
        transform: scale(0.5);
        transform-origin: top center;
    }
    .header { padding: 1rem 1rem; }
    section { padding: 2rem 1rem; }
    .footer { padding: 2rem 1rem 1rem; }
    .footer-content-wrapper { gap: 1rem; }
    .product-grid { gap: 1rem; }
    .category-grid { gap: 1rem; }
}

/* Phones (max-width: 450px) */
@media (max-width: 450px) {
    html { font-size: 78%; }
    .product-grid { grid-template-columns: 1fr; }
    .home .content h1 { font-size: 2.2rem; }
    .search-form { padding: 1rem 0.5rem; }
    .header .logo { font-size: 1.1rem; }
    .header .logo .logo-icon { height: 1.1rem; }
    .header .icons { gap: 0.7rem; }
    .shopping-cart { width: 100vw; }
    .promo-banner { padding: 1.5rem; }
    .footer { padding: 1.5rem 0.5rem 0.5rem; }
    .footer-content-wrapper { gap: 0.5rem; }
    .promotion .product-grid { grid-template-columns: 1fr; }
    .promotion-card .product-image { height: 12rem; }
}

/* Prevent horizontal scroll on all devices */
body, html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

        .header .icons a {
            color: inherit;
            text-decoration: none;
        }
        .footer .social-links .social-item a {
            display: flex;
            justify-content: center;
            align-items: center;
            line-height: 1; 
        }
        .footer .social-links .social-item .fa-telegram-plane {
            transform: translateX(1px);
        }

        .back-to-top {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            background: var(--main-color, #d35400);
            color: var(--white, #fff);
            width: 5rem;
            height: 5rem;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 2rem;
            text-decoration: none;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transform: translateY(100%);
            transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .back-to-top.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .back-to-top:hover {
            opacity: 0.9;
            transform: scale(1.05) translateY(0);
        }

        .cookie-consent-banner {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background-color: #2c3e50;
            color: #ecf0f1;
            padding: 1.5rem 2rem;
            z-index: 1050;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
            transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
        }

        .cookie-consent-banner.hidden {
            opacity: 0;
            transform: translateY(100%);
            pointer-events: none;
        }

        .cookie-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            max-width: 1200px;
            width: 100%;
            gap: 2rem;
        }

        .cookie-content p {
            margin: 0;
            font-size: 1.4rem;
        }

        .cookie-content .btn {
            flex-shrink: 0;
        }

        @media (max-width: 768px) {
            .cookie-content {
                flex-direction: column;
                text-align: center;
                gap: 1.5rem;
            }
        }

        /* --- Search Popup Styles --- */
        .search-results-popup {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #1e1e1e;
            border: 1px solid #333;
            border-radius: 0.5rem;
            max-height: 50vh;
            overflow-y: auto;
            z-index: 1100;
            display: none;
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
        }

        .search-result-item {
            display: flex;
            align-items: center;
            padding: 1rem 1.5rem;
            cursor: pointer;
            border-bottom: 1px solid #333;
            transition: background-color 0.2s ease;
        }

        .search-result-item:last-child {
            border-bottom: none;
        }

        .search-result-item:hover {
            background-color: #2c2c2c;
        }

        .search-result-item img {
            width: 4.5rem;
            height: 4.5rem;
            object-fit: cover;
            margin-right: 1.5rem;
            border-radius: 0.3rem;
            flex-shrink: 0;
        }

        .search-result-item .info {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .search-result-item .info .name {
            font-size: 1.4rem;
            color: #ecf0f1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 0.3rem;
        }

        .search-result-item .info .price {
            font-size: 1.3rem;
            color: var(--main-color, #d35400);
            font-weight: bold;
        }

        .highlighted-product {
            box-shadow: 0 0 15px 5px var(--main-color, #d35400);
            border-radius: 1rem;
            transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
            transform: scale(1.02);
        }

        /* --- Chatbot Styles --- */
        #chatbot-toggle-btn {
            position: fixed;
            bottom: 8rem;
            right: 1.5rem;
            background: var(--main-color);
            color: var(--white);
            width: 5rem;
            height: 5rem;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 2.4rem;
            cursor: pointer;
            z-index: 1001;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
            transition: transform 0.2s ease;
        }

        #chatbot-toggle-btn:hover {
            transform: scale(1.1);
        }

        .chatbot-widget {
            position: fixed;
            bottom: 14rem;
            right: 1.5rem;
            width: 35rem;
            max-width: 90vw;
            background: #2c3e50;
            border-radius: 1rem;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            z-index: 1001;
            opacity: 0;
            transform: translateY(20px);
            visibility: hidden;
            transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
            font-family: 'Battambang', sans-serif;
            /* Apply Khmer font */
        }

        .chatbot-widget.active {
            opacity: 1;
            transform: translateY(0);
            visibility: visible;
        }

        .chatbot-header {
            padding: 1rem 1.5rem;
            background: var(--main-color);
            color: var(--white);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .chatbot-header h3 {
            margin: 0;
            font-size: 1.6rem;
        }

        .chatbot-header #close-chatbot-btn {
            font-size: 2rem;
            cursor: pointer;
            background: none;
            border: none;
            color: white;
        }

        .chatbot-messages {
            height: 30rem;
            padding: 1.5rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            background-color: #34495e;
        }

        .bot-message {
            background: #1e1e1e;
            color: var(--white);
            padding: 1rem;
            border-radius: 1rem 1rem 1rem 0;
            align-self: flex-start;
            max-width: 80%;
            font-size: 1.4rem;
            line-height: 1.6;
            /* Increased line-height for better Khmer readability */
        }

        .chatbot-options {
            padding: 1rem;
            border-top: 1px solid #4a627a;
            display: flex;
            flex-wrap: wrap;
            gap: 0.8rem;
            justify-content: center;
        }

        .chatbot-option-btn {
            background: var(--main-color);
            color: var(--white);
            border: none;
            padding: 0.8rem 1.2rem;
            border-radius: 2rem;
            cursor: pointer;
            font-size: 1.3rem;
            font-family: 'Battambang', sans-serif;
            /* Ensure button inherits font */
            transition: background-color 0.2s ease;
        }

        .chatbot-option-btn:hover {
            background-color: #e67e22;
        }
    