/* ============================================================
   AutoParts Hub - Complete Theme CSS
   Mobile-first responsive e-commerce stylesheet
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS Variables
   ---------------------------------------------------------- */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --secondary: #F97316;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --bottom-nav-height: 64px;
    --header-height: 56px;
}

/* ----------------------------------------------------------
   2. Reset / Base Styles
   ---------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: var(--gray-50);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
    color: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

/* ----------------------------------------------------------
   3. Mobile Header
   ---------------------------------------------------------- */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    gap: var(--space-sm);
    z-index: 1000;
    padding-top: var(--safe-top);
    box-shadow: var(--shadow-sm);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.header-logo i,
.header-logo svg {
    font-size: 1.25rem;
    color: var(--primary);
}

.header-search {
    flex: 1;
    position: relative;
    min-width: 0;
}

.header-search input {
    width: 100%;
    height: 36px;
    padding: 0 var(--space-md) 0 36px;
    background: var(--gray-100);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--gray-800);
    transition: all 0.2s ease;
}

.header-search input::placeholder {
    color: var(--gray-400);
}

.header-search input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-search .search-icon {
    position: absolute;
    left: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.875rem;
    pointer-events: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.header-action-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--gray-600);
    font-size: 1.125rem;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.header-action-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ----------------------------------------------------------
   4. Main Content
   ---------------------------------------------------------- */
.main-content {
    padding-top: calc(var(--header-height) + var(--safe-top));
    min-height: 100vh;
}

/* ----------------------------------------------------------
   5. Container
   ---------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ----------------------------------------------------------
   6. Section Titles
   ---------------------------------------------------------- */
.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding: 0 var(--space-md);
}

.section-header .section-title {
    margin-bottom: 0;
}

.see-all {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.see-all:hover {
    color: var(--primary-dark);
}

.see-all i,
.see-all svg {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.see-all:hover i,
.see-all:hover svg {
    transform: translateX(2px);
}

/* ----------------------------------------------------------
   7. Buttons
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #DC2626;
    border-color: #DC2626;
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #16A34A;
    border-color: #16A34A;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ----------------------------------------------------------
   8. Form Elements
   ---------------------------------------------------------- */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

.form-control {
    width: 100%;
    padding: 10px var(--space-md);
    font-size: 0.9375rem;
    color: var(--gray-800);
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    line-height: 1.5;
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-text {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: var(--space-xs);
}

.form-text.text-danger {
    color: var(--danger);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ----------------------------------------------------------
   9. Cards
   ---------------------------------------------------------- */
.card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: var(--space-md);
}

/* ----------------------------------------------------------
   10. Status Badges
   ---------------------------------------------------------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-active,
.status-processing {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.status-success,
.status-completed,
.status-delivered {
    background: #DCFCE7;
    color: #166534;
}

.status-danger,
.status-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

.status-warning,
.status-shipping {
    background: #FEF3C7;
    color: #92400E;
}

/* ----------------------------------------------------------
   11. Hero Slider
   ---------------------------------------------------------- */
.hero-slider {
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.hero-slide {
    display: flex;
    align-items: center;
    min-height: 160px;
    padding: var(--space-lg) var(--space-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.hero-slide::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: -30px;
    right: 40px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 65%;
}

.hero-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.hero-content p {
    font-size: 0.8125rem;
    opacity: 0.9;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 20px;
    background: #fff;
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.hero-btn:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

.hero-image {
    position: absolute;
    right: var(--space-md);
    bottom: 0;
    width: 35%;
    max-width: 160px;
    opacity: 0.15;
    z-index: 1;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    position: absolute;
    bottom: var(--space-sm);
    left: 0;
    right: 0;
    z-index: 5;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slider-dot.active {
    width: 20px;
    background: #fff;
}

/* ----------------------------------------------------------
   12. Quick Categories
   ---------------------------------------------------------- */
.quick-categories {
    padding: var(--space-md) 0;
}

.categories-grid {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 var(--space-md);
}

.categories-grid::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    min-width: 72px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.category-item:hover {
    transform: translateY(-2px);
}

.category-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    color: var(--primary);
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.category-item:hover .category-icon {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
}

.category-item span {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--gray-600);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
}

/* ----------------------------------------------------------
   13. Flash Sale
   ---------------------------------------------------------- */
.flash-sale {
    padding: var(--space-md) 0;
}

.flash-sale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    margin-bottom: var(--space-md);
}

.flash-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--danger);
}

.flash-title .flash-icon {
    display: inline-flex;
    animation: flash 1s ease-in-out infinite;
}

.countdown {
    display: flex;
    align-items: center;
    gap: 4px;
}

.countdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 4px;
    background: var(--gray-900);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums;
}

.countdown-separator {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 0.875rem;
}

/* ----------------------------------------------------------
   14. Product Cards
   ---------------------------------------------------------- */
.product-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: var(--gray-100);
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    padding: 2px 8px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.product-badge.badge-new {
    background: var(--success);
}

.product-badge.badge-hot {
    background: var(--secondary);
}

.product-info {
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: var(--space-xs);
    min-height: calc(0.8125rem * 1.4 * 2);
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 2px;
}

.product-price-old {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-bottom: var(--space-xs);
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: var(--space-xs);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.6875rem;
    color: var(--warning);
}

.product-rating span {
    color: var(--gray-500);
    margin-left: 2px;
}

.product-sold {
    font-size: 0.6875rem;
    color: var(--gray-400);
    white-space: nowrap;
}

/* ----------------------------------------------------------
   15. Products Scroll (Horizontal)
   ---------------------------------------------------------- */
.products-scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 var(--space-md);
    scroll-snap-type: x mandatory;
}

.products-scroll::-webkit-scrollbar {
    display: none;
}

.products-scroll .product-card {
    min-width: 140px;
    max-width: 140px;
    scroll-snap-align: start;
}

/* ----------------------------------------------------------
   16. Products Grid
   ---------------------------------------------------------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: 0 var(--space-md);
}

/* ----------------------------------------------------------
   17. Shop Cards
   ---------------------------------------------------------- */
.shop-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 200px;
    max-width: 200px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.shop-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.shop-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
}

.shop-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
}

.shop-info {
    min-width: 0;
}

.shop-info h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-info p {
    font-size: 0.6875rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-stats {
    display: flex;
    border-top: 1px solid var(--gray-100);
}

.shop-stat {
    flex: 1;
    padding: var(--space-sm);
    text-align: center;
}

.shop-stat:not(:last-child) {
    border-right: 1px solid var(--gray-100);
}

.shop-stat .stat-value {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gray-800);
    display: block;
}

.shop-stat .stat-label {
    font-size: 0.625rem;
    color: var(--gray-500);
}

/* ----------------------------------------------------------
   18. Shops Scroll
   ---------------------------------------------------------- */
.shops-scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 var(--space-md);
    scroll-snap-type: x mandatory;
}

.shops-scroll::-webkit-scrollbar {
    display: none;
}

.shops-scroll .shop-card {
    scroll-snap-align: start;
}

/* ----------------------------------------------------------
   19. Featured Banner
   ---------------------------------------------------------- */
.featured-banner {
    margin: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--secondary) 0%, #EA580C 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.featured-banner::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.featured-banner h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 2;
}

.featured-banner p {
    font-size: 0.8125rem;
    opacity: 0.9;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 2;
}

.featured-banner .btn {
    background: #fff;
    color: var(--secondary);
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.featured-banner .btn:hover {
    background: var(--gray-100);
}

/* ----------------------------------------------------------
   20. Bottom Navigation
   ---------------------------------------------------------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    padding-bottom: var(--safe-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--space-xs) 0;
    min-width: 56px;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 0.625rem;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}

.nav-item i,
.nav-item svg {
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

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

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.nav-item .cart-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(calc(50% + 8px));
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ----------------------------------------------------------
   21. Desktop Footer
   ---------------------------------------------------------- */
.desktop-footer {
    display: none;
    background: var(--gray-800);
    color: var(--gray-300);
    padding-top: 48px;
    margin-top: var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.footer-brand .footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-brand .footer-logo i,
.footer-brand .footer-logo svg {
    color: var(--primary);
}

.footer-brand p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-400);
}

.footer-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--gray-400);
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-700);
    color: var(--gray-300);
    border-radius: var(--radius-full);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.footer-social a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding: var(--space-lg) 0;
    margin-top: 48px;
}

.footer-bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.footer-payments {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-payments img,
.footer-payments span {
    height: 24px;
    padding: 4px 8px;
    background: var(--gray-700);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
}

/* ----------------------------------------------------------
   22. Skeleton Loading Animation
   ---------------------------------------------------------- */
@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200px 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--space-sm);
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-image {
    width: 100%;
    padding-top: 100%;
}

.skeleton-circle {
    border-radius: var(--radius-full);
}

/* ----------------------------------------------------------
   23. Flash Icon Animation
   ---------------------------------------------------------- */
@keyframes flash {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ----------------------------------------------------------
   24. Visibility Utility Classes
   ---------------------------------------------------------- */
.desktop-only {
    display: none !important;
}

.mobile-only {
    display: block !important;
}

/* ----------------------------------------------------------
   25. Utility Classes
   ---------------------------------------------------------- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--gray-500);
}

.fw-bold {
    font-weight: 700;
}

.fw-semibold {
    font-weight: 600;
}

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.d-flex { display: flex; }
.d-grid { display: grid; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ----------------------------------------------------------
   26. Auth Pages
   ---------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: var(--gray-50);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xl);
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.auth-header .auth-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.auth-header h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
}

.auth-header p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.auth-form .form-group {
    margin-bottom: var(--space-md);
}

.auth-form .form-control {
    padding: 12px var(--space-md);
}

.auth-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: var(--space-sm);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: 0.875rem;
    color: var(--gray-500);
}

.auth-footer a {
    font-weight: 600;
    color: var(--primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.auth-social {
    display: flex;
    gap: var(--space-sm);
}

.auth-social .btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-700);
    border-radius: var(--radius-sm);
}

.auth-social .btn:hover {
    background: var(--gray-50);
}

/* ----------------------------------------------------------
   27. Page Title
   ---------------------------------------------------------- */
.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-xs);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: var(--space-lg);
}

/* ----------------------------------------------------------
   28. Order Tabs
   ---------------------------------------------------------- */
.order-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 var(--space-md);
    gap: 0;
    position: sticky;
    top: var(--header-height);
    z-index: 50;
}

.order-tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex-shrink: 0;
    padding: var(--space-md) var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    background: none;
    cursor: pointer;
    text-align: center;
}

.tab-item:hover {
    color: var(--gray-700);
}

.tab-item.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

/* ----------------------------------------------------------
   29. Order Cards
   ---------------------------------------------------------- */
.order-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: var(--space-sm) var(--space-md);
    overflow: hidden;
}

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

.order-header .order-id {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.order-header .order-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.order-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.order-status.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.order-status.status-processing {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.order-status.status-shipping {
    background: #DBEAFE;
    color: #1E40AF;
}

.order-status.status-delivered {
    background: #DCFCE7;
    color: #166534;
}

.order-status.status-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

.order-items {
    padding: var(--space-md);
}

.order-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
}

.order-item:not(:last-child) {
    border-bottom: 1px solid var(--gray-100);
}

.order-item-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
}

.order-item-info {
    flex: 1;
    min-width: 0;
}

.order-item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-800);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-item-qty {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.order-item-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.order-total {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.order-total .total-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--danger);
    margin-left: var(--space-xs);
}

/* ----------------------------------------------------------
   30. Product Detail Page
   ---------------------------------------------------------- */
.product-gallery {
    position: relative;
    background: #fff;
}

.gallery-main {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-100);
    overflow: hidden;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbs {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.gallery-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: var(--primary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-info {
    padding: var(--space-md);
    background: #fff;
}

.product-detail-info .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--danger);
}

.product-detail-info .product-price-old {
    font-size: 0.9375rem;
    margin-left: var(--space-sm);
}

.product-detail-info .product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-line-clamp: unset;
    min-height: auto;
    margin-top: var(--space-sm);
    margin-bottom: var(--space-md);
}

.variant-options {
    margin: var(--space-md) 0;
}

.variant-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.variant-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.variant-option {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.variant-option:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.variant-option.active,
.variant-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.variant-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.specs-table {
    width: 100%;
    margin: var(--space-md) 0;
}

.specs-table tr:nth-child(even) {
    background: var(--gray-50);
}

.specs-table td {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--gray-100);
}

.specs-table td:first-child {
    font-weight: 600;
    color: var(--gray-600);
    width: 35%;
    white-space: nowrap;
}

.specs-table td:last-child {
    color: var(--gray-800);
}

.review-summary {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: #fff;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.review-average {
    text-align: center;
    min-width: 80px;
}

.review-average .avg-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.review-average .avg-stars {
    color: var(--warning);
    font-size: 0.875rem;
    margin: var(--space-xs) 0;
}

.review-average .avg-count {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.rating-bars {
    flex: 1;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 4px;
}

.rating-bar-row .star-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    width: 20px;
    text-align: right;
}

.rating-bar-row .bar-track {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.rating-bar-row .bar-fill {
    height: 100%;
    background: var(--warning);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.rating-bar-row .bar-count {
    font-size: 0.75rem;
    color: var(--gray-400);
    width: 24px;
}

.review-card {
    background: #fff;
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
}

.review-card:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    object-fit: cover;
}

.review-user-info .review-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.review-user-info .review-date {
    font-size: 0.6875rem;
    color: var(--gray-400);
}

.review-stars {
    color: var(--warning);
    font-size: 0.75rem;
    margin-bottom: var(--space-sm);
}

.review-text {
    font-size: 0.8125rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.review-images {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.review-images img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    cursor: pointer;
}

.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    padding-bottom: calc(var(--space-sm) + var(--safe-bottom));
    z-index: 100;
}

.bottom-action-bar .action-btn-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 48px;
    padding: var(--space-sm);
    color: var(--gray-500);
    font-size: 0.625rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
}

.bottom-action-bar .action-btn-icon i,
.bottom-action-bar .action-btn-icon svg {
    font-size: 1.125rem;
}

.bottom-action-bar .btn-add-cart {
    flex: 1;
    padding: 12px;
    background: var(--secondary);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bottom-action-bar .btn-add-cart:hover {
    background: #EA580C;
}

.bottom-action-bar .btn-buy-now {
    flex: 1;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bottom-action-bar .btn-buy-now:hover {
    background: var(--primary-dark);
}

/* ----------------------------------------------------------
   31. Cart Page
   ---------------------------------------------------------- */
.cart-group {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: var(--space-sm) var(--space-md);
    overflow: hidden;
}

.cart-group-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
}

.cart-group-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.cart-group-header .shop-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.cart-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    align-items: flex-start;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: var(--space-sm);
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info .item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-800);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.cart-item-info .item-variant {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: var(--space-sm);
}

.cart-item-info .item-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--danger);
}

.cart-item-info .item-price-old {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: var(--space-sm);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: var(--space-sm);
}

.quantity-control button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-control button:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.quantity-control button:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.quantity-control button:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.quantity-control button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity-control .quantity-value {
    width: 40px;
    height: 28px;
    text-align: center;
    border-top: 1px solid var(--gray-300);
    border-bottom: 1px solid var(--gray-300);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-800);
    background: #fff;
}

.order-summary {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: var(--space-md);
    padding: var(--space-md);
}

.order-summary h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.summary-row:last-of-type {
    border-top: 1px solid var(--gray-200);
    padding-top: var(--space-md);
    margin-top: var(--space-sm);
    font-weight: 700;
    color: var(--gray-900);
}

.summary-row .total-price {
    font-size: 1.125rem;
    color: var(--danger);
}

.cart-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    padding-bottom: calc(var(--space-sm) + var(--safe-bottom));
    z-index: 100;
    gap: var(--space-md);
}

.cart-actions .select-all {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.cart-actions .cart-total {
    margin-left: auto;
    text-align: right;
}

.cart-actions .cart-total .total-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.cart-actions .cart-total .total-amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--danger);
}

.cart-actions .btn-checkout {
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

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

/* ----------------------------------------------------------
   32. Checkout Page
   ---------------------------------------------------------- */
.checkout-section {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: var(--space-sm) var(--space-md);
    padding: var(--space-md);
}

.checkout-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.checkout-section h3 i,
.checkout-section h3 svg {
    color: var(--primary);
}

.address-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.address-card:hover {
    border-color: var(--primary);
}

.address-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.address-card.selected::after {
    content: '\2713';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.address-card .address-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.address-card .address-phone {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: var(--space-xs);
}

.address-card .address-detail {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.5;
}

.address-card .address-default {
    display: inline-block;
    margin-top: var(--space-sm);
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.payment-option {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-option:hover {
    border-color: var(--primary);
}

.payment-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.payment-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.payment-option .payment-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 1.125rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

.payment-option .payment-info {
    flex: 1;
}

.payment-option .payment-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
}

.payment-option .payment-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ----------------------------------------------------------
   33. Profile Page
   ---------------------------------------------------------- */
.profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: var(--space-xl) var(--space-md);
    padding-top: calc(var(--space-xl) + var(--header-height));
    color: #fff;
    text-align: center;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    margin: 0 auto var(--space-sm);
    display: block;
    background: rgba(255, 255, 255, 0.2);
}

.profile-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.profile-email {
    font-size: 0.8125rem;
    opacity: 0.8;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    background: #fff;
    margin: calc(-1 * var(--space-md)) var(--space-md) var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
}

.profile-stat {
    text-align: center;
}

.profile-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    display: block;
}

.profile-stat .stat-label {
    font-size: 0.6875rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.profile-menu {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: var(--space-sm) var(--space-md);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    text-decoration: none;
    color: var(--gray-800);
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--gray-100);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--gray-50);
}

.menu-item .menu-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    flex-shrink: 0;
}

.menu-item .menu-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.menu-item .menu-arrow {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
}

.menu-item.danger .menu-icon {
    background: #FEE2E2;
    color: var(--danger);
}

.menu-item.danger .menu-text {
    color: var(--danger);
}

/* ----------------------------------------------------------
   34. Search Page
   ---------------------------------------------------------- */
.search-page {
    padding-top: calc(var(--header-height) + var(--safe-top));
}

.search-filters {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: var(--header-height);
    z-index: 50;
}

.search-filters::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 14px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background: var(--gray-200);
}

.filter-chip.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.filter-chip i,
.filter-chip svg {
    font-size: 0.75rem;
}

.sort-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 32px 6px 14px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
}

.sort-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-results-info {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ----------------------------------------------------------
   35. Shop Page
   ---------------------------------------------------------- */
.shop-profile {
    background: #fff;
    margin-bottom: var(--space-sm);
}

.shop-banner {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    object-fit: cover;
    position: relative;
}

.shop-info-card {
    padding: var(--space-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-top: -24px;
    position: relative;
    z-index: 2;
}

.shop-info-card .shop-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    border: 3px solid #fff;
    box-shadow: var(--shadow-md);
    background: #fff;
}

.shop-info-card .shop-details {
    flex: 1;
    min-width: 0;
    padding-top: var(--space-lg);
}

.shop-info-card .shop-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.shop-info-card .shop-location {
    font-size: 0.8125rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.shop-info-card .shop-rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
    font-size: 0.8125rem;
}

.shop-info-card .shop-rating .stars {
    color: var(--warning);
}

.shop-info-card .shop-rating span {
    color: var(--gray-500);
}

.shop-stats-row {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md) var(--space-md);
}

.shop-stats-row .stat {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.shop-stats-row .stat strong {
    color: var(--gray-800);
}

.shop-actions {
    display: flex;
    gap: var(--space-sm);
    padding: 0 var(--space-md) var(--space-md);
}

.shop-actions .btn {
    flex: 1;
}

/* ----------------------------------------------------------
   36. Flash / Alert Messages
   ---------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

.alert i,
.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #93C5FD;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    font-size: 1rem;
    transition: opacity 0.2s ease;
    color: inherit;
}

.alert-close:hover {
    opacity: 1;
}

/* ----------------------------------------------------------
   37. Empty State
   ---------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px var(--space-lg);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: var(--space-md);
}

.empty-icon img,
.empty-icon svg {
    width: 80px;
    height: 80px;
    opacity: 0.4;
}

.empty-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: var(--space-xs);
}

.empty-subtext {
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin-bottom: var(--space-lg);
    max-width: 280px;
}

/* ----------------------------------------------------------
   38. Loading Spinner
   ---------------------------------------------------------- */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.loading-spinner.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-spinner.spinner-lg {
    width: 44px;
    height: 44px;
    border-width: 4px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: var(--space-md);
}

.loading-center p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ----------------------------------------------------------
   39. Misc / Shared Components
   ---------------------------------------------------------- */

/* Divider */
.divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-md) 0;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8125rem;
    color: var(--gray-500);
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumbs a {
    color: var(--gray-500);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .separator {
    color: var(--gray-300);
    font-size: 0.625rem;
}

.breadcrumbs .current {
    color: var(--gray-800);
    font-weight: 500;
}

/* Modal / Overlay */
.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;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--gray-500);
    font-size: 1.125rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.modal-body {
    padding: var(--space-md);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: calc(var(--header-height) + var(--space-md));
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-800);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.toast-success {
    background: var(--success);
}

.toast.toast-danger {
    background: var(--danger);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-lg) var(--space-md);
}

.pagination .page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination .page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ----------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   ---------------------------------------------------------- */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }

    .category-icon {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .category-item span {
        font-size: 0.75rem;
    }

    .hero-slide {
        min-height: 200px;
        padding: var(--space-xl) var(--space-lg);
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.9375rem;
    }

    .products-scroll .product-card {
        min-width: 160px;
        max-width: 160px;
    }

    .shop-card {
        min-width: 220px;
        max-width: 220px;
    }

    .checkout-section {
        margin: var(--space-md) auto;
        max-width: 640px;
    }

    .order-card {
        margin: var(--space-sm) auto;
        max-width: 640px;
    }

    .auth-card {
        padding: 40px;
    }

    .modal-content {
        border-radius: var(--radius-lg);
        margin-bottom: 10vh;
    }

    .modal-overlay {
        align-items: center;
    }

    .footer-grid {
        padding: 0 var(--space-lg);
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    :root {
        --header-height: 70px;
    }

    body {
        padding-bottom: 0;
    }

    .mobile-header {
        height: 70px;
        padding: 0 var(--space-lg);
    }

    .header-logo {
        font-size: 1.125rem;
    }

    .header-search input {
        height: 40px;
        font-size: 0.9375rem;
    }

    .main-content {
        padding-top: calc(70px + var(--safe-top));
    }

    .container {
        padding: 0 var(--space-lg);
    }

    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--space-md);
    }

    .hero-slide {
        min-height: 260px;
        padding: 40px;
        border-radius: var(--radius-lg);
        margin: 0 var(--space-md);
    }

    .hero-content h2 {
        font-size: 1.75rem;
    }

    .hero-content p {
        font-size: 1rem;
        max-width: 400px;
    }

    .hero-btn {
        padding: 10px 28px;
        font-size: 0.9375rem;
    }

    .category-icon {
        width: 72px;
        height: 72px;
        font-size: 1.75rem;
    }

    .category-item span {
        font-size: 0.8125rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .products-scroll .product-card {
        min-width: 180px;
        max-width: 180px;
    }

    .shop-card {
        min-width: 240px;
        max-width: 240px;
    }

    .flash-title {
        font-size: 1.25rem;
    }

    .countdown-item {
        min-width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    /* Hide bottom nav on desktop */
    .bottom-nav {
        display: none;
    }

    /* Show desktop footer */
    .desktop-footer {
        display: block;
    }

    /* Visibility utilities */
    .desktop-only {
        display: block !important;
    }

    .mobile-only {
        display: none !important;
    }

    /* Product detail desktop layout */
    .product-detail-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
        max-width: 1200px;
        margin: 0 auto;
        padding: var(--space-lg);
    }

    .product-gallery {
        position: sticky;
        top: calc(70px + var(--space-lg));
        align-self: start;
    }

    .gallery-main {
        border-radius: var(--radius-md);
    }

    .bottom-action-bar {
        position: sticky;
        bottom: auto;
        box-shadow: none;
        border-top: none;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-md);
        margin-top: var(--space-md);
        padding-bottom: var(--space-sm);
    }

    /* Cart page desktop layout */
    .cart-layout {
        display: grid;
        grid-template-columns: 1fr 360px;
        gap: var(--space-lg);
        max-width: 1200px;
        margin: 0 auto;
        padding: var(--space-lg);
        align-items: start;
    }

    .order-summary {
        position: sticky;
        top: calc(70px + var(--space-lg));
    }

    /* Checkout desktop layout */
    .checkout-layout {
        display: grid;
        grid-template-columns: 1fr 360px;
        gap: var(--space-lg);
        max-width: 1200px;
        margin: 0 auto;
        padding: var(--space-lg);
        align-items: start;
    }

    /* Profile desktop layout */
    .profile-header {
        padding-top: calc(var(--space-xl) + 70px);
    }

    .profile-content {
        max-width: 640px;
        margin: 0 auto;
    }

    /* Search page desktop grid */
    .search-layout {
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: var(--space-lg);
        max-width: 1200px;
        margin: 0 auto;
        padding: var(--space-lg);
    }

    .search-sidebar {
        position: sticky;
        top: calc(70px + var(--space-lg));
        align-self: start;
    }

    /* Shop page desktop */
    .shop-banner {
        height: 200px;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .shop-info-card .shop-avatar {
        width: 80px;
        height: 80px;
    }

    /* Featured banner desktop */
    .featured-banner {
        margin: var(--space-lg) auto;
        max-width: calc(1200px - var(--space-xl));
        padding: var(--space-xl) 40px;
    }

    .featured-banner h3 {
        font-size: 1.5rem;
    }

    .featured-banner p {
        font-size: 0.9375rem;
        max-width: 400px;
    }

    /* Auth page desktop */
    .auth-card {
        max-width: 440px;
        padding: 48px;
    }

    /* Pagination */
    .pagination .page-btn {
        min-width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
}

/* Large Desktop: 1280px+ */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }

    .footer-grid {
        max-width: 1280px;
    }

    .footer-bottom-inner {
        max-width: 1280px;
    }
}

/* ----------------------------------------------------------
   Print Styles
   ---------------------------------------------------------- */
@media print {
    .mobile-header,
    .bottom-nav,
    .desktop-footer,
    .bottom-action-bar,
    .cart-actions {
        display: none !important;
    }

    body {
        padding: 0;
        background: #fff;
        color: #000;
    }

    .main-content {
        padding-top: 0;
    }

    .product-card,
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
