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

:root {
    --primary: #00a650;
    --primary-dark: #008f44;
    --secondary: #ff6b35;
    --background: #f5f5f5;
    --white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 8px 12px;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--background);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--primary);
    background: var(--white);
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.user-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 18px;
    text-decoration: none;
    transition: all 0.3s;
}
.user-btn:hover { background: var(--primary); color: var(--white); }

.cart-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.cart-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--secondary);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.main-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 52px 0 100px;
}

/* Category nav — sticky, cuộn ngang */
.category-nav {
    position: sticky;
    top: 52px;
    z-index: 100;
    background: var(--white);
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.category-nav::-webkit-scrollbar { display: none; }

.category-nav-item {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.15s;
}

.category-nav-item:active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Menu sections */
.menu-section {
    margin-bottom: 8px;
    scroll-margin-top: 88px;
}

.menu-section-header {
    padding: 10px 16px 8px;
    background: var(--white);
    position: sticky;
    top: 88px;
    z-index: 90;
    border-bottom: 1px solid var(--border);
}

.menu-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Products */
.products-section {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 0;
    margin-bottom: 4px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.view-all {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.product-card:active {
    box-shadow: var(--shadow-lg);
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card-action {
    padding: 0 10px 10px;
}

.product-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--background);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-info {
    padding: 10px 10px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-price-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.original-price {
    font-size: 12px;
    color: var(--text-light);
    text-decoration: line-through;
}

.product-image-wrap {
    position: relative;
}

.discount-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.product-image-wrap .discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.add-to-cart {
    margin-top: 8px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.15s;
}

.add-to-cart:active {
    background: var(--primary-dark);
}

/* Floating Cart */
.floating-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: var(--white);
    padding: 10px 16px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 166, 80, 0.4);
    z-index: 999;
    transition: transform 0.15s;
}

.floating-cart:active {
    transform: scale(0.95);
}

.floating-cart i {
    font-size: 16px;
}

.cart-total {
    font-size: 14px;
    font-weight: 700;
}

.cart-badge {
    background: var(--white);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cart Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.cart-modal {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--background);
    cursor: pointer;
    font-size: 18px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--background);
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--secondary);
    font-weight: 600;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.qty-btn:hover {
    background: var(--background);
}

.qty-value {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 18px;
}

.cart-summary-total {
    font-weight: 700;
    color: var(--secondary);
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.checkout-btn:hover {
    background: var(--primary-dark);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-light);
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    padding: 48px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Product Detail */
.product-detail {
    max-width: 600px;
    margin: 0 auto;
    padding: 52px 0 100px;
    background: var(--background);
}

.detail-back {
    padding: 10px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.detail-back a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.detail-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--background);
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-info {
    background: var(--white);
    padding: 16px;
    margin-bottom: 8px;
}

.detail-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.detail-price-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.detail-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.detail-original-price {
    font-size: 16px;
    color: var(--text-light);
    text-decoration: line-through;
}

.detail-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.variant-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.variant-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

.detail-add-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s;
}

.detail-add-btn:active {
    background: var(--primary-dark);
}

.detail-description {
    background: var(--white);
    padding: 16px;
    margin-bottom: 8px;
}

.detail-description h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.detail-description-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
}

.detail-description-body ul {
    padding-left: 20px;
    margin-bottom: 8px;
}

.detail-description-body li {
    margin-bottom: 4px;
}

.detail-description-body p {
    margin-bottom: 8px;
}

.detail-related {
    background: var(--white);
    padding: 16px;
}

.related-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.detail-related .product-grid {
    padding: 0;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

/* ── Hot Deal Section ───────────────────────────────────── */
.hot-deal-section {
    margin: 8px 0 16px;
    overflow: hidden;
}

.hot-deal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #ff6b35 0%, #e74c3c 100%);
    padding: 14px 16px;
    margin: 0 12px;
    border-radius: 14px 14px 0 0;
}

.hot-deal-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hot-deal-fire {
    font-size: 28px;
    animation: fireShake 0.8s ease-in-out infinite alternate;
    display: inline-block;
}

@keyframes fireShake {
    0%   { transform: rotate(-8deg) scale(1); }
    100% { transform: rotate(8deg) scale(1.15); }
}

.hot-deal-title {
    font-size: 18px;
    font-weight: 800;
    color: white;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.hot-deal-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    margin-top: 1px;
}

.hot-deal-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 16px;
    background: linear-gradient(180deg, #fff3f0 0%, #ffffff 60%);
    margin: 0 12px;
    border-radius: 0 0 14px 14px;
    border: 1px solid #ffd5c8;
    border-top: none;
}

.hot-deal-scroll::-webkit-scrollbar { display: none; }
.hot-deal-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Hot Deal Card ──────────────────────────────────────── */
.hot-deal-card {
    flex-shrink: 0;
    width: 150px;
    scroll-snap-align: start;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ffd5c8;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(231,76,60,0.12);
}

.hot-deal-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.hot-deal-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fef5f3;
}

.hot-deal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hot-deal-card:active .hot-deal-img {
    transform: scale(1.04);
}

.hot-deal-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    background: linear-gradient(135deg, #ff6b35, #e74c3c);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(231,76,60,0.4);
    animation: pulse 1.5s ease-in-out infinite;
}

.hot-deal-card-info {
    padding: 8px 10px 6px;
    flex: 1;
}

.hot-deal-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 5px;
}

.hot-deal-prices {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hot-deal-price {
    font-size: 15px;
    font-weight: 800;
    color: #e74c3c;
}

.hot-deal-original {
    font-size: 11px;
    color: var(--text-light);
    text-decoration: line-through;
}

.hot-deal-add-btn {
    margin: 0 10px 10px;
    padding: 7px 0;
    background: linear-gradient(135deg, #ff6b35, #e74c3c);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    width: calc(100% - 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.hot-deal-add-btn:active {
    opacity: 0.85;
    transform: scale(0.98);
}
