/* ============================================
   IEMS5718 Shop - Modern Design System
   ============================================ */

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --accent: #F59E0B;
    --accent-hover: #D97706;
    --bg: #F9FAFB;
    --bg-white: #FFFFFF;
    --text: #111827;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --success: #10B981;
    --danger: #EF4444;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Header
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-white);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
}

.user-chip small {
    color: var(--text-secondary);
    font-weight: 500;
}

.header-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--bg-white);
    transition: all var(--transition);
}

.header-link-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.header-link-btn.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

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

/* ============================================
   Cart
   ============================================ */
.cart-container {
    position: relative;
}

.cart-icon {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 1.1rem;
    background: transparent;
    border: none;
    color: var(--text);
}

.cart-icon:hover { background: var(--border-light); }

.cart-count {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: var(--radius-full);
    position: absolute;
    top: 2px;
    right: 4px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-count.bounce {
    animation: cartBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); }
    60% { transform: scale(0.85); }
    100% { transform: scale(1); }
}

.cart-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 360px;
    max-height: 480px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.cart-container:hover .cart-dropdown,
.cart-container.active .cart-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.cart-dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.cart-items { padding: 12px 16px; }

.empty-cart {
    text-align: center;
    color: var(--text-light);
    padding: 24px 0;
    font-size: 0.9rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.cart-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

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

.cart-item-details h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.cart-item-quantity {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}

.cart-item-quantity:focus { border-color: var(--primary); }

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition);
    line-height: 1;
}

.cart-item-remove:hover {
    color: var(--danger);
    background: #FEE2E2;
}

.cart-total {
    padding: 14px 0 4px;
    border-top: 2px solid var(--border);
    margin-top: 8px;
    text-align: right;
    font-size: 1rem;
    color: var(--text);
}

.cart-dropdown-footer { padding: 12px 16px 16px; }

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

.checkout-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.checkout-btn:disabled {
    background: var(--border);
    color: var(--text-light);
    cursor: not-allowed;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    text-align: center;
    padding: 80px 24px 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.hero h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
    position: relative;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 480px;
    margin: 0 auto 32px;
    position: relative;
}

.hero-btn {
    display: inline-block;
    background: white;
    color: var(--primary);
    padding: 14px 36px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition);
    position: relative;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ============================================
   Filter Bar (Category + Search)
   ============================================ */
.section-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 0;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.filter-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.category-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 220px;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0.5;
}

.search-box input {
    width: 100%;
    padding: 9px 36px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-family: var(--font);
    background: var(--bg-white);
    outline: none;
    transition: all var(--transition);
    color: var(--text);
}

.search-box input::placeholder { color: var(--text-light); }

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-clear {
    position: absolute;
    right: 8px;
    background: var(--border-light);
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    line-height: 1;
}

.search-clear:hover {
    background: var(--border);
    color: var(--text);
}

.search-result-count {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.search-result-count span {
    font-weight: 600;
    color: var(--primary);
}

.highlight {
    background: #FEF3C7;
    color: var(--text);
    border-radius: 2px;
    padding: 0 1px;
}

.category-pill {
    padding: 8px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.category-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.category-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* ============================================
   Products Grid
   ============================================ */
.products {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.5s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-card-image {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 13 / 10;
    background: var(--border-light);
}

.product-card-image img,
.product-card-image video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card-image img {
    transition: transform 0.5s ease;
}

.product-card-image video {
    background: #000;
    pointer-events: none;
}

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

.product-card-body {
    padding: 20px;
}

.product-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.product-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.product-card h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition);
}

.product-card h3 a:hover { color: var(--primary); }

.product-card-desc {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.product-card .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

.add-to-cart-btn.added {
    background: var(--success);
}

.add-to-cart-btn .btn-text { transition: all 0.2s ease; }

/* ============================================
   Fly to Cart Animation
   ============================================ */
.fly-item {
    position: fixed;
    z-index: 9999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.9;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

@keyframes flyToCart {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: scale(0.6) translate(var(--fly-x-mid), var(--fly-y-mid));
        opacity: 0.8;
    }
    100% {
        transform: scale(0.2) translate(var(--fly-x), var(--fly-y));
        opacity: 0;
    }
}

/* ============================================
   Loading Skeleton
   ============================================ */
.loading-text {
    text-align: center;
    color: var(--text-light);
    padding: 60px 0;
    font-size: 0.95rem;
}

.skeleton-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.skeleton-image {
    aspect-ratio: 13 / 10;
    background: linear-gradient(90deg, var(--border-light) 25%, #e8e8e8 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-body { padding: 20px; }

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--border-light) 25%, #e8e8e8 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

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

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Product Detail Page
   ============================================ */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.product-gallery { position: relative; }

.main-image {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 13 / 10;
    background: var(--border-light);
}

.main-image img,
.main-image video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.main-image img {
    transition: transform 0.4s ease;
}

.main-image:hover img { transform: scale(1.03); }

.main-image.is-video {
    background: #000;
}

.thumbnail-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.thumbnail {
    width: 72px;
    height: 72px;
    padding: 0;
    appearance: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    opacity: 0.7;
    background: var(--border-light);
    overflow: hidden;
    position: relative;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail:hover { opacity: 1; }

.thumbnail.active {
    border-color: var(--primary);
    opacity: 1;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.thumbnail-badge {
    position: absolute;
    right: 4px;
    bottom: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: white;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.thumbnail-fallback,
.media-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.product-info {
    padding: 0;
}

.product-info .breadcrumb-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.product-info .breadcrumb-text a {
    color: var(--primary);
    text-decoration: none;
}

.product-info .breadcrumb-text a:hover { text-decoration: underline; }

.product-info h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 12px;
}

.product-info .price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
}

.media-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: #E0F2FE;
    color: #0369A1;
    font-size: 0.82rem;
    font-weight: 700;
}

.product-info .description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 32px;
}

.product-info .description h3 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.add-to-cart-section {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn-add-cart {
    flex: 1;
    padding: 16px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-add-cart:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

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

.btn-buy-now {
    flex: 1;
    padding: 16px 32px;
    background: var(--bg-white);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-buy-now:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* ============================================
   Notification
   ============================================ */
.notification {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--bg-white);
    color: var(--text);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 4px solid var(--success);
    max-width: 360px;
}

.notification::before {
    content: '\2713';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.notification.slide-in {
    animation: notifIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.notification.slide-out {
    animation: notifOut 0.3s ease-in forwards;
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.error::before {
    content: '!';
    background: var(--danger);
}

@keyframes notifIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes notifOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

/* ============================================
   Footer
   ============================================ */
footer {
    background: var(--text);
    color: var(--text-light);
    text-align: center;
    padding: 32px 24px;
    font-size: 0.85rem;
}

footer a { color: var(--primary-light); }

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.breadcrumb-bar a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

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

.breadcrumb-bar span { color: var(--text); font-weight: 500; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.18), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.auth-card {
    width: min(100%, 460px);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-lg);
    border-radius: 24px;
    padding: 32px 28px;
    backdrop-filter: blur(18px);
}

.auth-card h1 {
    font-size: 1.9rem;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    font: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.auth-submit {
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.2);
}

.auth-message {
    min-height: 24px;
    font-size: 0.88rem;
    font-weight: 600;
}

.auth-message.error {
    color: var(--danger);
}

.auth-message.success {
    color: var(--success);
}

/* ============================================
   API Status
   ============================================ */
.api-status { display: none; }

.api-status.show {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.api-status .error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--danger);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .header-inner { padding: 0 16px; }

    .nav-links { gap: 16px; }
    .nav-links a { font-size: 0.85rem; }
    .header-actions { gap: 8px; }
    .user-chip { display: none; }

    .hero { padding: 60px 20px 48px; }
    .hero h2 { font-size: 1.75rem; }

    .filter-bar { padding: 16px 16px 0; flex-direction: column; align-items: stretch; }
    .search-box { min-width: 100%; }

    .products { padding: 16px 16px 32px; }

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

    .product-card-body { padding: 12px; }
    .product-card h3 { font-size: 0.9rem; }
    .product-card-desc { -webkit-line-clamp: 1; min-height: 1.3em; }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 16px;
    }

    .product-info h1 { font-size: 1.5rem; }

    .add-to-cart-section { flex-direction: column; }

    .cart-dropdown { width: calc(100vw - 32px); right: -8px; }

    .notification { right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .nav-links { gap: 12px; }
}

/* ============================================
   No Results
   ============================================ */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ============================================
   Old classes compatibility (for product.html)
   ============================================ */
.product-image {
    display: block;
    width: 100%;
    aspect-ratio: 13 / 10;
    object-fit: cover;
}

@supports not (aspect-ratio: 1 / 1) {
    .product-card-image::before,
    .main-image::before {
        content: "";
        display: block;
        padding-top: 76.923%;
    }
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.add-to-cart { composes: add-to-cart-btn; }

.rating { margin-bottom: 1.5rem; color: #F59E0B; }

.specifications table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.specifications td { padding: 0.5rem; border-bottom: 1px solid var(--border-light); }
.specifications td:first-child { font-weight: 600; width: 40%; }
.buy-now { background: var(--success); }
.buy-now:hover { background: #059669; }
