:root {
    --primary-color: #2c2c2c;
    --primary-dark: #1a1a1a;
    --secondary-color: #4a4a4a;
    --accent-color: #6b6b6b;
    --success-color: #4a4a4a;
    --danger-color: #333333;
    --warning-color: #5a5a5a;
    --dark-color: #1a1a1a;
    --light-color: #f5f5f5;
    --gradient-primary: linear-gradient(135deg, #2c2c2c 0%, #4a4a4a 100%);
    --gradient-secondary: linear-gradient(135deg, #6b6b6b 0%, #8a8a8a 100%);
    --gradient-success: linear-gradient(135deg, #4a4a4a 0%, #5a5a5a 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --font-base: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

/* ===================== IMAGE STABILITY (prevent flash/flicker) ===================== */
/* Only apply GPU compositing to images that are actually animated */
.product-image,
.product-img,
.card-img-top {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Contain product cards to their own stacking context */
.product-card,
.featured-product-card {
    contain: layout style;
}

/* ===================== GLOBAL TYPOGRAPHY ===================== */
body {
    font-family: var(--font-base);
    font-size: 15px;
    color: #333;
    background-color: #f4f5f7;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-base);
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 0.95rem; }

p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

a {
    color: #2c2c2c;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover { color: #555; }

small, .small { font-size: 0.82rem; }

.text-muted { color: #888 !important; font-size: 0.88rem; }

label.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-control, .form-select {
    font-size: 0.93rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid #e0e0e0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: #2c2c2c;
    box-shadow: 0 0 0 3px rgba(44,44,44,0.08);
}

.input-group-text {
    background: #f8f8f8;
    border: 1.5px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
}

/* ===================== BUTTONS ===================== */
.btn {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    transition: all 0.25s ease;
}

.btn-lg {
    font-size: 1rem;
    padding: 13px 28px;
    border-radius: var(--radius-md);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 6px 14px;
}

/* ===================== CARDS ===================== */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.card-header {
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 16px 24px;
}

.card-body { padding: 24px; }
.card-footer { padding: 14px 24px; }

/* ===================== BADGES ===================== */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 5px 10px;
    border-radius: 20px;
}

/* ===================== ALERTS ===================== */
.alert {
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    border: none;
    padding: 14px 20px;
}

/* ===================== SECTION TITLES ===================== */
.section-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a1a1a;
    letter-spacing: -0.03em;
}

.section-subtitle {
    font-size: 0.95rem;
    color: #777;
    margin-bottom: 40px;
}

.navbar {
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.badge-notification {
    position: absolute;
    top: -5px;
    right: -10px;
    font-size: 0.7rem;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 0.75rem;
    position: relative;
    padding: 5px 15px;
}

.mobile-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

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

.mobile-cart-badge {
    position: absolute;
    top: 0;
    right: 5px;
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: bold;
}

.hero-section {
    background: linear-gradient(135deg, #2c2c2c 0%, #4a4a4a 100%);
    color: white;
    padding: 80px 0;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.product-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    background: white;
    overflow: hidden;
    position: relative;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card:hover::before {
    transform: scaleX(1);
}

.product-card img {
    height: 250px;
    object-fit: cover;
}

.product-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.35s ease;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

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

.product-image-wrapper {
    overflow: hidden;
    border-radius: 16px;
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.product-image-wrapper::before {
    content: none;
}

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

.product-card .product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.product-card .product-compare-price {
    font-size: 1rem;
    text-decoration: line-through;
    color: #999;
    margin-left: 10px;
}

.product-card .btn {
    width: 100%;
}

.category-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
    margin-bottom: 10px;
}

.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-sidebar h5 {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}

.product-detail-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.product-detail-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-detail-compare-price {
    font-size: 1.5rem;
    text-decoration: line-through;
    color: #999;
    margin-left: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
}

.cart-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-summary {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 90px;
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cart-summary .summary-row:last-child {
    border-bottom: none;
    font-size: 1.3rem;
    font-weight: 700;
}

.testimonial-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    height: 100%;
}

.testimonial-card .rating {
    color: #ffc107;
    margin-bottom: 15px;
}

.testimonial-card .message {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
}

.testimonial-card .author {
    font-weight: 600;
    color: var(--dark-color);
}

.testimonial-card .designation {
    color: #999;
    font-size: 0.9rem;
}

.faq-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.faq-item h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.order-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.order-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.order-status.pending {
    background: #fff3cd;
    color: #856404;
}

.order-status.processing {
    background: #cfe2ff;
    color: #084298;
}

.order-status.shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.order-status.delivered {
    background: #d4edda;
    color: #155724;
}

.order-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.profile-sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-sidebar .nav-link {
    color: var(--dark-color);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.profile-sidebar .nav-link:hover,
.profile-sidebar .nav-link.active {
    background: var(--primary-color);
    color: white;
}

.profile-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

@media (max-width: 991px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .product-card img {
        height: 200px;
    }
    
    .filter-sidebar {
        margin-bottom: 20px;
    }
    
    body {
        padding-bottom: 70px;
    }
}

@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none;
    }
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

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

.bg-primary {
    background-color: var(--primary-color) !important;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 5rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 15px;
}

.image-gallery {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.image-gallery img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

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

.related-products {
    margin-top: 60px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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