/* ============================================
   63HMOOB - Modern Premium Design System
   ============================================ */

/* CSS Variables - Modern Color Palette */
:root {
    /* Primary Colors - Deep Coral to Orange */
    --primary-color: #FF4D00;
    --primary-hover: #E64400;
    --primary-light: #FFF0EB;
    --primary-gradient: linear-gradient(135deg, #FF6B35 0%, #FF4D00 50%, #E64400 100%);

    /* Accent Colors */
    --accent-gold: #FFB800;
    --accent-red: #EF4444;
    --accent-green: #10B981;
    --accent-blue: #3B82F6;
    --accent-purple: #8B5CF6;

    /* Backgrounds */
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-dark: #0F172A;
    --bg-glass: rgba(255, 255, 255, 0.8);

    /* Text Colors */
    --text-main: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --text-white: #FFFFFF;

    /* Borders */
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;

    /* Shadows - Modern glassmorphism */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(255, 77, 0, 0.3);

    /* Radius - Modern rounded */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Force form elements to inherit font */
button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans Lao', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

main {
    flex: 1;
    padding-bottom: 3rem;
    min-width: 0;
    /* Prevents flex item from forcing width */
    width: 100%;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* ============================================
   Header & Navigation - Premium Glass Effect
   ============================================ */
header {
    background: var(--primary-gradient);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: transform var(--transition-fast);
}

.brand:hover {
    transform: scale(1.02);
}

.brand img {
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    position: relative;
    backdrop-filter: blur(10px);
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    transform: translateY(-1px);
}

/* ============================================
   Section Titles - Modern Style
   ============================================ */
.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.5px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Flash Deal Badge */
.flash-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    }

    50% {
        box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5);
    }
}

/* ============================================
   Product Grid - Modern Masonry Look
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 480px) {
    .product-grid {
        gap: 1.25rem;
    }
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 960px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Product Card - Premium Glass Card */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-spring);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    border: 1px solid var(--border-light);
}

.product-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card-image img {
    transform: scale(1.1);
}

/* Product Badges - Modern Pills */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.product-badge.new {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.product-badge.hot {
    background: var(--primary-gradient);
    box-shadow: var(--shadow-glow);
}

/* Product Info */
.product-card-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main);
}

.product-card-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.price-current {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary-color);
}

.price-original {
    font-size: 0.8rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.price-discount {
    font-size: 0.7rem;
    color: var(--accent-red);
    font-weight: 700;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
}

/* Sold Count */
.product-sold {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-sold::before {
    content: '🔥';
    font-size: 0.7rem;
}

/* ============================================
   Buttons - Modern Glass Effect
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-white);
    box-shadow: 0 4px 14px rgba(255, 77, 0, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 0, 0.45);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

/* ============================================
   Forms - Modern Floating Labels
   ============================================ */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--bg-card);
    color: var(--text-main);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

input::placeholder {
    color: var(--text-light);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   Cards - Premium Glass Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    background: linear-gradient(to bottom, #FFFFFF 0%, #FAFBFC 100%);
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   Search Form - Modern Style
   ============================================ */
/* ============================================
   Search Form - Modern Pill Design
   ============================================ */
.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 999px;
    padding: 0.25rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--primary-color);
    transition: all var(--transition-fast);
    max-width: 600px;
    margin: 0 auto;
}

.search-form:focus-within {
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-input {
    flex: 1;
    border: none !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem;
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
    min-width: 0;
    /* Prevents flex overflow */
}

.search-btn {
    background: var(--primary-gradient);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-btn:hover {
    transform: scale(1.05);
}

.search-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Responsive Utilities */
@media (max-width: 900px) {
    .nav-label {
        display: none;
    }

    .nav-links a {
        padding: 0.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

/* ============================================
   Tables - Modern Clean Design
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(to bottom, var(--bg-body) 0%, #F1F5F9 100%);
}

thead th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--bg-body);
}

tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
}

/* ============================================
   Footer - Modern Dark Footer
   ============================================ */
footer {
    background: linear-gradient(to bottom, var(--bg-dark) 0%, #020617 100%);
    color: rgba(255, 255, 255, 0.7);
    padding: 2.5rem 0;
    margin-top: auto;
}

footer .container {
    text-align: center;
}

footer p {
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--accent-gold);
}

/* ============================================
   Skeleton Loading - Shimmer Effect
   ============================================ */
.skeleton-loading {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   Status Badges - Modern Pills
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-pending {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #B45309;
}

.status-confirmed {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    color: #1D4ED8;
}

.status-shipped {
    background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
    color: #4338CA;
}

.status-completed {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #047857;
}

.status-cancelled {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #B91C1C;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    filter: grayscale(0.3);
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 52px;
    height: 52px;
    background: var(--primary-gradient);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(255, 77, 0, 0.4);
}

/* ============================================
   Utilities
   ============================================ */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-muted {
    color: var(--text-muted);
}

.font-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 640px) {
    .navbar {
        padding: 0.625rem 0;
    }

    .brand {
        font-size: 1.25rem;
    }

    .brand img {
        width: 28px !important;
        height: 28px !important;
    }

    .nav-links a {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.375rem;
    }

    .product-card-info {
        padding: 0.75rem;
    }

    .product-card-name {
        font-size: 0.85rem;
    }

    .price-current {
        font-size: 1rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    header,
    footer,
    .back-to-top,
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Header Cart Badge */
.nav-cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--accent-gold);
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============================================
   Quantity Selector - Modern Pill Style
   ============================================ */
.quantity-wrapper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    /* Light gray background */
    border-radius: 999px;
    /* Pill shape */
    padding: 2px;
    width: fit-content;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quantity-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.quantity-btn:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 50px;
    height: 36px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    padding: 0;
    -moz-appearance: textfield;
    appearance: none;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ============================================
   Responsive Cart List (Replaces Table)
   ============================================ */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    align-items: center;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f1f5f9;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cart-item-name {
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.cart-item-variant {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary-color);
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.cart-footer {
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 800;
}

/* Desktop Styles */
@media (min-width: 768px) {
    .cart-item {
        grid-template-columns: 80px 2fr 1fr 1fr 1fr auto;
        padding: 1.5rem;
    }

    .cart-item-actions {
        flex-direction: row;
        align-items: center;
    }

    .cart-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* ============================================
   Admin Backend - Responsive Design System
   ============================================ */

/* Base Admin Layout */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.admin-nav-btns {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Admin Card Component */
.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Admin Tables - Responsive */
.admin-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--bg-body);
    white-space: nowrap;
}

/* Admin Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

/* Admin Form Layout */
.admin-form-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Admin Action Buttons */
.admin-action-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Mobile First - Extra Small (< 480px) */
@media (max-width: 479px) {
    .container {
        padding: 0 0.75rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-nav-btns {
        width: 100%;
        flex-wrap: wrap;
    }

    .admin-nav-btns .btn {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 0;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .section-title::before {
        width: 3px;
        height: 22px;
    }

    /* Admin Tables on XS */
    .admin-table {
        min-width: 500px;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Admin Cards */
    .admin-form-card {
        padding: 1rem;
    }

    .admin-stat-card {
        padding: 1rem;
    }

    /* Modal adjustments */
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
    }

    /* Order detail specific */
    .order-layout {
        gap: 1rem !important;
    }

    .shipping-grid {
        gap: 0.75rem !important;
    }
}

/* Small devices (480px - 639px) */
@media (min-width: 480px) and (max-width: 639px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-nav-btns {
        width: 100%;
    }

    .admin-nav-btns .btn {
        flex: 1;
        text-align: center;
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

/* Medium devices (640px - 767px) */
@media (min-width: 640px) and (max-width: 767px) {
    .admin-header {
        flex-direction: row;
        align-items: center;
    }

    .admin-nav-btns .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Admin Dashboard Specific */
@media (max-width: 768px) {

    /* Dashboard header */
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-nav-btns {
        width: 100%;
    }

    .admin-nav-btns .btn {
        flex: 1;
        text-align: center;
        font-size: 0.875rem;
        padding: 0.5rem;
    }

    /* Filter forms */
    .filter-form,
    .report-filter-form {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100% !important;
    }

    .action-group {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .action-group .btn {
        flex: 1;
    }
}

/* Order Detail Specific */
@media (max-width: 992px) {
    .order-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .shipping-grid {
        grid-template-columns: 1fr !important;
    }

    .order-header-right {
        text-align: left !important;
        width: 100%;
    }

    /* Order items table */
    .order-items-table {
        min-width: 100%;
    }

    .order-items-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Carriers Page */
@media (max-width: 640px) {
    .carriers-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .carriers-header .btn {
        width: 100%;
        text-align: center;
    }

    .carrier-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .carrier-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Products Page */
@media (max-width: 640px) {
    .products-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .products-header .btn {
        width: 100%;
        text-align: center;
    }

    .product-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .product-actions a {
        display: block;
        text-align: center;
        padding: 0.5rem;
        background: var(--bg-body);
        border-radius: var(--radius-sm);
    }
}

/* Product Form */
@media (max-width: 640px) {

    .form-grid-3,
    .form-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .product-form-actions {
        flex-direction: column;
    }

    .product-form-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Gallery images */
    .gallery-images {
        justify-content: center;
    }
}

/* Reports Page */
@media (max-width: 640px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .admin-stat-card {
        padding: 1rem;
    }

    .admin-stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* Settings Page */
@media (max-width: 480px) {
    .settings-form {
        padding: 1rem;
    }

    .settings-section-title {
        font-size: 1rem;
    }
}

/* Admin Modals - Responsive */
@media (max-width: 480px) {

    [id$="Modal"]>.card,
    .modal-card {
        margin: 0.5rem;
        padding: 1rem;
        max-width: calc(100% - 1rem);
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

/* Print Styles for Admin */
@media print {

    .admin-nav-btns,
    .filter-form,
    .report-filter-form,
    .admin-action-btns,
    .no-print {
        display: none !important;
    }

    .admin-table-wrapper {
        overflow: visible;
    }

    .admin-table {
        min-width: 100%;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .admin-nav-btns .btn {
        padding: 0.75rem 1rem;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .admin-table td,
    .admin-table th {
        padding: 0.875rem;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    @media (min-width: 768px) {
        .container {
            padding-left: max(2rem, env(safe-area-inset-left));
            padding-right: max(2rem, env(safe-area-inset-right));
        }
    }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .admin-header {
        margin-bottom: 1rem;
    }

    .section-title {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }

    .admin-form-card {
        padding: 1rem;
    }

    .admin-stat-card {
        padding: 1rem;
    }
}