/**
 * An Nhien Cart CSS - Optimized Version
 * Status: ✅ OPTIMIZED v2.3.0 - Independent Quantity Buttons
 * Last Updated: 2025-10-20
 * * Change Log:
 * - Restored full original file content (1416 lines).
 * - Applied new font families, sizes, and weights as per style guide.
 * - Standardized headings and body text styles.
 * - Adjusted colors for prices and savings to match brand identity.
 * * CUSTOMIZATION (2025-10-20):
 * - Updated .checkout-btn color to #fcfbf7
 * - Added .checkout-btn:hover filter: brightness(1.1)
 * * CUSTOMIZATION (2025-10-20 v2):
 * - Updated header background to #73AC57
 * - Set header height to 60px
 * - Hid header links, centered logo
 * * CUSTOMIZATION (2025-10-20 v3):
 * - Repositioned .cart-message to bottom-center
 * - Added styles for new totals breakdown
 * * CUSTOMIZATION (2025-10-20 v4):
 * - Moved price block styles to .product-price
 * - Removed font styles from .product-price td
 * - Removed margin-top from .product-price-info
 * * CUSTOMIZATION (2025-10-20 v5):
 * - Replaced theme quantity buttons with custom .annhien-quantity-wrapper
 * - Hid .cart-header on mobile
 */

/* ========================================
   CSS VARIABLES - DESIGN SYSTEM
   ======================================== */
:root {
    /* Colors */
    --color-primary: #5D4725; /* Dark Brown for text, as requested */
    --color-primary-button: #C65834; /* Original brown for buttons */
    --color-primary-button-hover: #a84a2b;
    --color-primary-light: rgba(198, 88, 52, 0.1);
    --color-background: #fcfbf7;
    --color-surface: #FFFFFF;
    --color-text: #000000;
    --color-text-muted: rgba(0, 0, 0, 0.6);
    --color-text-light: rgba(0, 0, 0, 0.4);
    --color-error: #FF2121;
    --color-error-light: rgba(255, 33, 33, 0.1);
    --color-success: #2E7D32; /* Light Green */
    --color-success-light: rgba(46, 125, 50, 0.1);
    --color-border: #E5E5E5;
    --color-border-light: #F5F0E1;
    --color-divider: #F2EEE5;
    
    /* Spacing - 8px Grid System */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 40px;
    
    /* Typography -- UPDATED AS PER REQUEST */
    --font-family-base: 'Be Vietnam Pro', sans-serif;
    --font-family-heading: 'Phudu', serif;
    
    --font-size-xs: 11px;      /* Small text / note */
    --font-size-sm: 12px;
    --font-size-base: 14px;   /* Body text, H3 */
    --font-size-md: 16px;     /* H2 */
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;    /* Cart Title */
    --font-size-3xl: 32px;    /* H1 */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.4;    /* Headings */
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;  /* Body */
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.18);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 13px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --container-max-width: 1240px;
    --header-height: 60px; /* === UPDATED AS PER REQUEST === */
    --cart-left-width: 862px;
    --cart-right-width: 353px;
    --cart-gap: 25px;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
.annhien-cart-page {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    color: var(--color-text);
    background: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
}

.annhien-cart-page *,
.annhien-cart-page *::before,
.annhien-cart-page *::after {
    box-sizing: border-box;
}

.annhien-cart-page h1,
.annhien-cart-page h2,
.annhien-cart-page h3,
.annhien-cart-page h4{
    font-family: var(--font-family-heading);
    line-height: var(--line-height-tight);
    margin: 0;
    padding: 0;
}

/* General Heading Styles from Guide */
.annhien-cart-page h1 { font-size: 24px; font-weight: var(--font-weight-medium);}
.annhien-cart-page h2 { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); }
.annhien-cart-page h3 { font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); }

.annhien-cart-page a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-base);
}

.annhien-cart-page button {
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all var(--transition-base);
}

.annhien-cart-page img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   HEADER (CUSTOMIZED)
   ======================================== */
.annhien-header {
    background: #73AC57; /* === UPDATED === */
    border-bottom: none; /* === UPDATED === */
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.annhien-header .header-container {
    max-width: var(--container-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center; /* === UPDATED === */
    height: 100%;
}

.annhien-header .back-home,
.annhien-header .account-link,
.annhien-header .header-actions {
    display: none; /* === UPDATED === */
}

.annhien-header .logo {
    position: relative; /* === UPDATED === */
    left: auto; /* === UPDATED === */
    transform: none; /* === UPDATED === */
}

.annhien-header .logo img {
    width: 120px;
    transition: transform var(--transition-base);
}

.annhien-header .logo:hover img {
    transform: scale(1.05);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.annhien-cart-main {
    max-width: var(--container-max-width);
    margin: var(--space-3xl) auto;
    padding: 0 var(--space-xl);
}

/* ========================================
   EMPTY CART STATE
   ======================================== */
.cart-empty {
    text-align: center;
    padding: 80px var(--space-xl);
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
}

.cart-empty .empty-icon {
    font-size: 80px;
    margin-bottom: var(--space-xl);
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cart-empty h2 {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.cart-empty p {
    font-family: var(--font-family-base);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2xl);
    font-size: var(--font-size-md);
}

.cart-empty .btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-primary-button);
    color: var(--color-surface);
    padding: 14px var(--space-2xl);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-md);
    box-shadow: var(--shadow-sm);
}

.cart-empty .btn-continue-shopping:hover {
    background: var(--color-primary-button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   CART CONTAINER - 2 COLUMNS
   ======================================== */
.annhien-cart-container {
    display: grid;
    grid-template-columns: var(--cart-left-width) var(--cart-right-width);
    gap: var(--cart-gap);
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* ========================================
   LEFT COLUMN - CART ITEMS
   ======================================== */
.annhien-cart-left {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl) 20px;
    height: auto;
}

.annhien-cart-left .cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--color-border-light);
}

/* Section Title: "Giỏ hàng của bạn" */
.annhien-cart-left h2.cart-title {
    font-family: var(--font-family-heading);
    font-size: 24px; /* UPDATED */
    font-weight: 500; /* UPDATED */
    color: var(--color-text);
}

.annhien-cart-left .cart-count {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}

/* ========================================
   CART TABLE
   ======================================== */
.shop_table.cart {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 0;
}

.shop_table.cart thead th {
    font-weight: 500;
    font-size: var(--font-size-md)!important;
    color: var(--color-text);
    padding: 0 var(--space-sm) var(--space-lg) 0;
    text-align: left;
    letter-spacing: 0.5px;
    font-size: var(--font-size-sm);
}

.shop_table.cart thead th.product-thumbnail { width: 82px; }
.shop_table.cart thead th.product-name { width: auto; }
.shop_table.cart thead th.product-price { width: 200px; }
.shop_table.cart thead th.product-subtotal { width: 120px; text-align: right; }
.shop_table.cart thead th.product-remove { width: 50px; text-align: center; }

.shop_table.cart tbody tr.cart_item {
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color var(--transition-base);
}

.shop_table.cart tbody td {
    padding: var(--space-lg) var(--space-sm) var(--space-lg) 0;
    border: 0 !important;
    vertical-align: middle;
}

/* ========================================
   PRODUCT THUMBNAIL
   ======================================== */
.cart_item .product-thumbnail {
    width: 82px;
    padding-right: 0 !important;
}

.cart_item .product-thumbnail a {
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.cart_item .product-thumbnail a:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.cart_item .product-thumbnail img {
    width: 82px !important;
    height: 82px !important;
    object-fit: cover;
    display: block;
}

/* ========================================
   PRODUCT INFO
   ======================================== */
.cart_item .product-name {
    padding-left: var(--space-lg) !important;
    width: auto;
}

/* Product Name */
.cart_item .product-name a {
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    color: var(--color-text);
    display: block;
    margin-bottom: var(--space-sm);
    transition: color var(--transition-base);
    padding-right: 50px;
}

.cart_item .product-name a:hover {
    color: var(--color-primary-button);
}

.cart_item .product-price-info {
    margin-top: 0; /* === UPDATED === */
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Giá khuyến mãi */
.cart_item .product-price-info .price-current {
    font-weight: var(--font-weight-bold);
    color: var(--color-primary); /* Dark Brown */
    font-size: var(--font-size-base);
}

/* Giá gốc */
.cart_item .product-price-info .price-regular {
    font-weight: var(--font-weight-normal);
    color: var(--color-text-muted); /* Gray */
    text-decoration: line-through;
    font-size: var(--font-size-base);
}

/* Tiết kiệm */
.cart_item .product-saved {
    font-size: var(--font-size-base);
    color: var(--color-success); /* Light Green */
    font-weight: var(--font-weight-medium);
    display: inline-block;
    margin-top: -5px;
}

.mobile-view-info {
    display: none;
}

/* ========================================
   PRODUCT PRICE (DESKTOP)
   ======================================== */
.cart_item .product-price {
    /* === FONT STYLES REMOVED === */
    text-align: left;
}

/* === ADDED: Style for the container moved into .product-price === */
.cart_item .product-price .desktop-view-price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
}


/* ========================================
   CUSTOM QUANTITY STYLES (INDEPENDENT)
   ======================================== */

/* Ẩn .quantity-wrapper cũ do theme chèn vào */
.quantity-wrapper:not(.annhien-quantity-wrapper),
.quantity {
    display: none !important;
}

/* Wrapper mới */
.annhien-quantity-wrapper {
    display: inline-flex;
    align-items: center;
    border: 0px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 0px;
    margin-top: 0px;
}

/* Nút +/- tùy chỉnh */
.annhien-qty-btn {
    width: 80%;
    height: 20px;
    background: #e2fff0;
    border-radius: 4px;
    color: var(--color-primary-button);
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    margin-right: 3px;
    margin-left: 3px;
    transition: all var(--transition-base);
}

.annhien-qty-btn:hover {
    background: var(--color-primary-button);
    color: var(--color-surface);
}

/* Ô nhập số */
.annhien-qty-field {
    width: 60px;
    height: 24px;
    text-align: center;
    border: none;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    padding: 0 0px;
    background: transparent;
}

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

.annhien-qty-field:focus {
    outline: none;
}

/* ========================================
   PRODUCT SUBTOTAL
   ======================================== */
.cart_item .product-subtotal {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    text-align: right;
}

/* ========================================
   REMOVE BUTTON
   ======================================== */
.cart_item .product-remove {
    text-align: center;
}

.cart_item .product-remove a {
    color: var(--color-text-light);
    font-size: 24px;
    line-height: 1;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
}

.cart_item .product-remove a:hover {
    color: var(--color-error);
    background: var(--color-error-light);
    transform: rotate(90deg);
}

/* ========================================
   CART ACTIONS (UPDATE BUTTON & NOTES)
   ======================================== */
.shop_table.cart .actions {
    padding: var(--space-xl) 0 !important;
    text-align: right;
    clear: both;
    overflow: hidden;
    border-top: 2px solid var(--color-border-light);
}

.cart-notes-wrapper {
    margin-bottom: var(--space-lg);
    text-align: left;
}

.cart-notes-wrapper:has(> b:contains("Deprecated")) {
    display: none !important;
}

/* Tiêu đề: "Ghi chú đơn hàng" */
.cart-notes-wrapper label {
    display: block;
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 400;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

/* Mô tả phụ: Ghi chú đơn hàng */
.cart-notes-wrapper .note-description {
    font-family: var(--font-family-base);
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-light); /* Light Gray */
    margin-top: calc(-1 * var(--space-sm));
    margin-bottom: var(--space-md);
}

/* Trường nhập: Ghi chú */
.cart-notes-wrapper textarea {
    width: 100%;
    min-height: 80px;
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 400;
    resize: vertical;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.cart-notes-wrapper textarea:focus {
    outline: none;
    border-color: var(--color-primary-button);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Nút: "Cập nhật giỏ hàng" */
.shop_table.cart .actions button[name="update_cart"] {
    background: var(--color-background);
    color: var(--color-text);
    padding: 14px var(--space-2xl);
    border-radius: var(--radius-lg);
    font-family: var(--font-family-base);
    font-size: 14px; /* UPDATED */
    font-weight: 500; /* UPDATED */
    cursor: pointer;
    border: none;
    width: auto;
    min-width: 200px;
    display: inline-block;
    display: flex;
    justify-content: flex-end;
    letter-spacing: 0.5px;
}

.shop_table.cart .actions button[name="update_cart"]:hover {
 
    transform: translateY(-2px);
}

.shop_table.cart .actions button[name="update_cart"]:active {
    transform: translateY(0);
}

/* ========================================
   RIGHT SIDEBAR
   ======================================== */
.annhien-cart-right {
    display: flex;
    flex-direction: column;
    gap: var(--cart-gap);
}

/* ========================================
   COUPON BOX
   ======================================== */
.annhien-coupon-box {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl) var(--space-lg);
}

/* Tiêu đề: "Mã giảm giá" */
.annhien-coupon-box h3.coupon-title {
    font-family: var(--font-family-heading);
    font-size: 24px; /* UPDATED */
    font-weight: 500; /* UPDATED */
    color: var(--color-text);
    margin-bottom: var(--space-xl);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coupon-input-wrapper {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

/* Trường nhập mã */
#coupon_code {
    flex: 1;
    height: 44px;
    padding: 0 var(--space-lg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 400;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

#coupon_code:focus {
    outline: none;
    border-color: var(--color-primary-button);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

#coupon_code::placeholder {
    color: var(--color-text-light);
}

/* Nút: "Áp dụng" */
.apply-coupon-btn {
    height: 44px;
    padding: 0 var(--space-xl);
    background: var(--color-primary-button);
    color: var(--color-surface);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 600; /* UPDATED */
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.apply-coupon-btn:hover {
    background: var(--color-primary-button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.apply-coupon-btn:active {
    transform: translateY(0);
}

/* Applied Coupons */
.applied-coupons {
    margin-bottom: var(--space-xl);
}

.applied-coupons h4 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-md);
    color: var(--color-text);
    font-family: 'Be Vietnam Pro';

}

.applied-coupon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-success-light);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
    gap: var(--space-md);
    padding-right: var(--space-md);
    padding-left: var(--space-md);
    padding-top: var(--space-md);
    padding-bottom: -25px;
}

.applied-coupon-item .coupon-item-info strong {
    color: var(--color-success);
    font-weight: var(--font-weight-bold);
}

.remove-coupon {
    font-size: var(--font-size-sm);
    color: var(--color-error);
    cursor: pointer;
    font-weight: var(--font-weight-semibold);
    padding: var(--space-xs) var(--space-md);
    background: var(--color-error-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.remove-coupon:hover {
    background: var(--color-error);
    color: var(--color-surface);
}

/* Coupon List */
.coupon-list {
    margin-top: var(--space-lg);
}

/* Text: "Ưu đãi hiện có" */
.coupon-list h4.available-offers-title {
    font-family: var(--font-family-base);
    font-size: 11px;
    font-weight: 400;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.coupon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: #fcfbf7 !important;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
    gap: var(--space-md);
    transition: all var(--transition-base);
}

.coupon-item:hover {
    background: var(--color-primary-light);
    transform: translateX(4px);
}

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

.coupon-item .coupon-code {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-button);
    display: block;
    margin-bottom: var(--space-xs);
    letter-spacing: 0.5px;
}

.coupon-item .coupon-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
    line-height: var(--line-height-normal);
}

.coupon-apply-btn {
    background: var(--color-primary-button) !important;
    color: var(--color-surface) !important;
    opacity: 1 !important;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    border: none;
    box-shadow: var(--shadow-xs);
}

.coupon-apply-btn:hover {
    background: var(--color-primary-button-hover) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.coupon-applied {
    font-size: var(--font-size-sm);
    color: var(--color-success);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ========================================
   CART TOTALS (CUSTOMIZED)
   ======================================== */
.annhien-cart-totals {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl) var(--space-lg);
}

/* Tiêu đề: "Chi tiết thanh toán" */
.annhien-cart-totals h3.totals-title {
    font-family: var(--font-family-heading);
    font-size: 24px; /* UPDATED */
    font-weight: 500; /* UPDATED */
    color: var(--color-text);
    margin-bottom: var(--space-xl);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bảng thông tin */
.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.totals-row .label,
.totals-row .value {
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: 400;
}

/* Giá gốc */
.totals-row.original-total .label {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}
.totals-row.original-total .value {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

/* Giảm giá SP */
.totals-row.product-discount .label {
    color: var(--color-success);
    font-weight: var(--font-weight-medium);
}
.totals-row.product-discount .value {
    color: var(--color-success);
    font-weight: var(--font-weight-medium);
}

/* Tạm tính (Subtotal) */
.totals-row.sub-total .label {
    font-weight: var(--font-weight-medium);
}
.totals-row.sub-total .value {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
}

/* Giảm giá Coupon */
.totals-row.discount .value {
    color: var(--color-success);
    font-weight: var(--font-weight-medium);
}

.totals-divider {
    border-top: 2px solid var(--color-divider);
    margin: var(--space-lg) 0;
}

/* Tổng thanh toán */
.totals-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: #fcfbf7 !important;
    border-radius: var(--radius-lg);
}

.totals-final .label,
.totals-final .value {
    font-family: var(--font-family-base);
    font-size: 14px; /* UPDATED */
    font-weight: 600; /* UPDATED */
    color: var(--color-text);
}

.totals-final .value {
    font-size: var(--font-size-xl);
    color: var(--color-primary-button);
}

/* Nút chính: "Đặt mua sản phẩm" */
.checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    border-radius: var(--radius-lg);
    min-height: 52px;
    font-family: var(--font-family-base);
    font-size: 16px; /* UPDATED */
    font-weight: 600; /* UPDATED */
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-base);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    background: #C65834;
    color: #fcfbf7!important; /* === ADDED === */
}

/* === ADDED HOVER EFFECT === */
.checkout-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.savings-text {
    text-align: center;
    font-size: var(--font-size-x);
    color: var(--color-success);
    margin-top: var(--space-md);
    font-weight: var(--font-weight-medium);
}

/* ========================================
   BOTTOM BAR (MOBILE)
   ======================================== */
.annhien-bottom-bar {
    display: none;
}

/* ========================================
   FOOTER
   ======================================== */
.annhien-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-2xl) 0;
    margin-top: 60px;
    display: none;
}

.annhien-footer .footer-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    text-align: center;
}

.annhien-footer p {
    font-family: var(--font-family-base);
    color: var(--color-text-light); /* Light Gray */
    font-size: 11px; /* UPDATED */
    font-weight: 400;
    margin: 0;
}

/* ========================================
   MESSAGES & NOTIFICATIONS (RE-POSITIONED)
   ======================================== */
.cart-message {
    position: fixed;
    bottom: 20px; /* === UPDATED === */
    left: 50%; /* === UPDATED === */
    transform: translateX(-50%); /* === UPDATED === */
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* === UPDATED === */
    font-weight: var(--font-weight-medium);
    min-width: 280px;
}

/* === REMOVED @keyframes slideInRight === */

/* === ADDED @keyframes fadeInUp === */
@keyframes fadeInUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.cart-message.success {
    background: var(--color-success);
    color: var(--color-surface);
}

.cart-message.error {
    background: var(--color-error);
    color: var(--color-surface);
}

/* Loading Overlay */
.cart-updating {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--color-surface);
    padding: var(--space-xl) var(--space-3xl);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    z-index: 999999;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    
    :root {
        --space-xl: 16px;
        --header-height: 56px; /* === UPDATED === */
    }
    
    /* Header */
    .annhien-header .header-container {
        padding: 0 var(--space-lg);
    }
    
    .annhien-header .logo img {
        width: 120px;
    }
    
    /* === REMOVED .back-home, .account-link mobile styles === */
    
    /* Main */
    .annhien-cart-main {
        margin: 0;
        padding: 0;
    }
    
    /* Container */
    .annhien-cart-container {
        display: flex;
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    /* Left Column */
    .annhien-cart-left {
        width: 100%;
        margin: 0;
        padding: var(--space-xl) var(--space-lg);
        border-radius: 0;
        box-shadow: none;
        border-bottom: 8px solid var(--color-background);
    }
    
    .annhien-cart-left .cart-header {
        display: none; /* Ẩn hoàn toàn header giỏ hàng trên mobile */
    }
    
    .annhien-cart-left h2.cart-title {
        font-size: var(--font-size-xl);
    }
    
    .annhien-cart-left .cart-count {
        font-size: var(--font-size-sm);
    }
    
    /* Table */
    .shop_table.cart thead {
        display: none;
    }
    
    .shop_table.cart tbody tr.cart_item {
        display: flex;
        gap: var(--space-md);
        padding: var(--space-lg) 0;
        border-bottom: 0px solid var(--color-border-light);
        position: relative;
    }
    
    .shop_table.cart tbody tr.cart_item:last-child {
        border-bottom: 0px solid var(--color-border-light);
    }
    
    .shop_table.cart tbody tr:has(.actions) {
        display: table-row;
        border-bottom: none;
    }
    
    .shop_table.cart .actions {
        padding: var(--space-xl) 0 !important;
        text-align: center;
    }
    
    .shop_table.cart .actions button[name="update_cart"] {
  width: 100%;
  min-width: unset;
  padding: var(--space-lg) var(--space-xl);
  font-size: var(--font-size-sm);
  float: none; /* ❌ bỏ float */
  display: flex;              /* 👉 Dùng flexbox */
  justify-content: center;    /* Ngang giữa */
  align-items: center;        /* Dọc giữa */
  text-align: center;
}
    
    .shop_table.cart tbody td {
        padding: 0 !important;
        display: block;
        border: 0 !important;
        width: auto !important;
    }
    
    /* Product Card Mobile */
    .cart_item .product-thumbnail {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }
    
    .cart_item .product-thumbnail img {
        width: 100px !important;
        height: 100px !important;
        border-radius: var(--radius-md);
    }
    
    .cart_item .product-name {
        flex: 1;
        padding: 0 !important;
        display: flex;
        flex-direction: column;
    }
    
    .cart_item .product-name a {
        padding-right: 28px;
        margin-bottom: var(--space-xs);
        font-size: var(--font-size-base);
    }
    
    .cart_item .product-price,
    .cart_item .product-subtotal,
    .cart_item .desktop-view-price-info {
        display: none !important;
    }
    
    .cart_item .product-remove {
        position: absolute;
        top: var(--space-lg);
        right: 0;
    }
    
    .cart_item .product-remove a {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }
    
    /* Mobile Info - có xoá margin-top */
    .mobile-view-info { 
        display: flex;
        flex-direction: column;
        width: 100%;
        flex-grow: 1;
    }
    
    .mobile-price-info {
        display: flex;
        gap: var(--space-sm);
        align-items: center;
    }
    
    .mobile-price-info .price-current {
        font-size: var(--font-size-base);
        font-weight: var(--font-weight-bold);
        color: var(--color-primary);
        margin-top: -2px;
    }
    
    .mobile-price-info .price-regular {
        font-size: var(--font-size-base);
        color: var(--color-text-muted);
    }
    
    .mobile-saved {
        font-size: var(--font-size-base);
        color: var(--color-success);
        font-weight: var(--font-weight-medium);
        margin-top: -5px;
        margin-bottom: 8px;
    }
    
    /* ========================================
       CUSTOM QUANTITY STYLES (MOBILE)
       ======================================== */
    .annhien-quantity-wrapper {
        padding: 0px;
        border-radius: 6px;
        margin-top: 0px;
        align-self: flex-start;

    }

    .annhien-qty-btn {
        width: 14px;  /* Nhỏ theo yêu cầu */
        height: 18px; /* Nhỏ theo yêu cầu */
        font-size: 18px;
        font-weight: 400; /* Nét mảnh hơn */
    }

    .annhien-qty-field {
        width: 60px;
        height: 18px; /* Nhỏ theo yêu cầu */
        font-size: 12px;
        border-left: 1px solid var(--color-border);
        border-right: 1px solid var(--color-border);
        background: var(--color-surface);
    }
    
    /* Right Sidebar */
    .annhien-cart-right {
        width: 100%;
        padding: var(--space-xl) var(--space-lg);
        border-radius: 0;
        gap: var(--space-xl);
        background: var(--color-surface);
    }
    
    .annhien-coupon-box,
    .annhien-cart-totals {
        padding: 0;
        margin: 0 0 var(--space-xl) 0;
        box-shadow: none;
        border-bottom: 0px solid var(--color-border-light);
        padding-bottom: var(--space-xl);
    }
    
    .annhien-coupon-box:last-child,
    .annhien-cart-totals:last-child {
        border-bottom: none;
        padding-bottom: 130px;
        background: #FEFBF4;
        padding: 20px;
        border-radius: 10px;
        margin-bottom: 130px;
        margin-top:-30px;
    }
    
    .annhien-coupon-box h3.coupon-title,
    .annhien-cart-totals h3.totals-title {
        font-size: var(--font-size-xl);
        margin-bottom: var(--space-lg);
    }
    
    #coupon_code,
    .apply-coupon-btn {
        height: 48px;
        font-size: var(--font-size-base);
    }
    
    .coupon-item,
    .applied-coupon-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        padding: var(--space-lg);
    }
    
    .coupon-item-info {
        width: 100%;
    }
    
    .coupon-apply-btn,
    .remove-coupon {
        width: 100%;
        text-align: center;
        padding: var(--space-md) var(--space-lg);
        justify-content: center;
    }
    
    .coupon-applied {
        align-self: flex-start;
    }
    
    /* Hide desktop totals */
    .annhien-cart-totals .totals-divider,
    .annhien-cart-totals .totals-final,
    .annhien-cart-totals .checkout-btn,
    .annhien-cart-totals .savings-text {
        display: none !important;
    }
    
    /* Bottom Bar */
    .annhien-bottom-bar {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--color-surface);
        padding: var(--space-lg);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
        z-index: 999;
        border-top: 1px solid var(--color-border);
    }
    
    .annhien-bottom-bar .bottom-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--space-md);
    }
    
    .annhien-bottom-bar .bottom-total .label {
        font-weight: var(--font-weight-medium);
        font-size: var(--font-size-base);
    }
    
    .annhien-bottom-bar .bottom-total .value {
        font-weight: var(--font-weight-bold);
        font-size: var(--font-size-xl);
        color: var(--color-primary-button);
    }
    
    .annhien-bottom-bar .checkout-btn {
        width: 100%;
        min-height: 52px;
        font-size: var(--font-size-md);
    }
    
    /* Footer */
    .annhien-footer {
        margin-bottom: 110px;
        border-top: none;
        background: var(--color-background);
    }
    
    /* Messages (Mobile) */
    .cart-message {
        bottom: 120px; /* === UPDATED (to be above bottom bar) === */
        left: var(--space-md);
        right: var(--space-md);
        transform: none; /* === UPDATED === */
        max-width: none;
        width: auto;
        padding: var(--space-md) var(--space-lg);
        font-size: var(--font-size-sm);
    }

    @keyframes fadeInUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    /* Empty Cart Mobile */
    .cart-empty {
        padding: 60px var(--space-xl);
        margin: var(--space-xl);
        border-radius: var(--radius-xl);
    }
    
    .cart-empty .empty-icon {
        font-size: 60px;
        margin-bottom: var(--space-lg);
    }
    
    .cart-empty h2 {
        font-size: var(--font-size-xl);
        margin-bottom: var(--space-md);
    }
    
    .cart-empty p {
        font-size: var(--font-size-base);
        margin-bottom: var(--space-xl);
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--color-primary-button);
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--color-primary-button);
    color: var(--color-surface);
}

/* --- Fallback for old styles, can be removed after HTML update --- */
.annhien-cart-left h2:not(.cart-title) {
    font-family: 'Be Vietnam Pro';
    font-size: 14px;
    font-weight: 400;
    padding-bottom: 0px;
}
.annhien-coupon-box h3:not(.coupon-title) {
    font-family: 'Be Vietnam Pro' ;
    font-size: 14px;
    font-weight: 500;
    padding-bottom: 10px;
}
.annhien-cart-totals h3:not(.totals-title) {
    font-family: 'Be Vietnam Pro';
    font-size: 16px;
    font-weight: 500;
    padding-bottom: 10px;
    margin-top: 10px;
}
.coupon-list h4:not(.available-offers-title){
    font-family: 'Be Vietnam Pro';
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    margin-top: 26px;
}

.annhien-cart-page p {
    margin-top: 0px;
    margin-bottom: 10px;
}
.quantity-wrapper.annhien-quantity-wrapper input.annhien-qty-field[type="number"] {
        width: 42px;
        height: 18px;
        font-size: 12px !important; /* Giữ !important để tuyệt đối an toàn */
        border-left: 1px solid var(--color-border);
        border-right: 1px solid var(--color-border);
        background: var(--color-surface);
        text-align: center;
    padding:10px
    }