/* ============================================
   ShopEase - Custom Styles
   Bootstrap 5 E-Commerce Theme
   ============================================ */

:root {
    --primary: #6c63ff;
    --primary-dark: #5a52d5;
    --secondary: #ff6584;
    --gold: #d4af37;
    --font: 'Poppins', sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    color: #333;
    background: #f8f9fa;
}

/* ---- Override Bootstrap Primary ---- */
.btn-primary, .bg-primary { background-color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-primary:hover { background-color: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }
.btn-outline-primary { color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-outline-primary:hover { background-color: var(--primary) !important; color: #fff !important; }
.text-primary { color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }

/* ---- Navbar ---- */
.navbar { transition: box-shadow 0.3s; }
.navbar-brand { letter-spacing: -0.5px; }
.nav-link { font-weight: 500; font-size: 0.9rem; }
.nav-link.active { color: var(--primary) !important; }

/* ---- Hero Slider ---- */
.hero-carousel .carousel-item {
    height: 480px;
    background-size: cover;
    background-position: center;
}
.hero-carousel .carousel-caption { bottom: 60px; }
.hero-carousel .carousel-caption h1 { font-size: clamp(1.5rem, 4vw, 3rem); font-weight: 700; text-shadow: 2px 2px 8px rgba(0,0,0,0.4); }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 100%);
}
.hero-slide-1 { background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.hero-slide-2 { background-image: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.hero-slide-3 { background-image: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

/* ---- Category Cards ---- */
.category-card {
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    height: 200px;
    position: relative;
}
.category-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(0,0,0,0.15); }
.category-card .cat-bg {
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s;
}
.category-card:hover .cat-bg { transform: scale(1.08); }
.category-card .cat-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 60%);
    display: flex; align-items: flex-end; padding: 16px;
}
.category-card .cat-name { color: #fff; font-weight: 600; font-size: 1rem; margin: 0; }

/* Category gradient backgrounds */
.cat-men    { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.cat-women  { background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%); }
.cat-kids   { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.cat-gold   { background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%); }
.cat-silver { background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%); }
.cat-diamond{ background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }

/* ---- Product Cards ---- */
.product-card {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: #fff;
    position: relative;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.12); }
.product-card .card-img-wrap {
    position: relative;
    overflow: hidden;
    height: 260px;
    background: #f8f9fa;
    display: flex; align-items: center; justify-content: center;
}
.product-card .card-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.product-card:hover .card-img-wrap img { transform: scale(1.07); }
.product-card .badge-sale {
    position: absolute; top: 10px; left: 10px;
    background: #e74c3c; color: #fff;
    padding: 4px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
    z-index: 2;
}
.product-card .badge-new {
    position: absolute; top: 10px; left: 10px;
    background: #27ae60; color: #fff;
    padding: 4px 10px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
    z-index: 2;
}
.product-card .action-btns {
    position: absolute; top: 10px; right: 10px;
    display: flex; flex-direction: column; gap: 6px;
    opacity: 0; transition: opacity 0.3s;
    z-index: 2;
}
.product-card:hover .action-btns { opacity: 1; }
.product-card .action-btns .btn {
    width: 36px; height: 36px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.product-card .card-body { padding: 14px; }
.product-card .product-name { font-size: 0.9rem; font-weight: 600; color: #333; margin-bottom: 4px; }
.product-card .product-category { font-size: 0.75rem; color: #888; margin-bottom: 6px; }
.product-card .price { font-weight: 700; color: var(--primary); font-size: 1rem; }
.product-card .price-original { text-decoration: line-through; color: #aaa; font-size: 0.85rem; }
.product-card .stars i { font-size: 0.7rem; }
.product-card .btn-cart {
    width: 100%; margin-top: 10px;
    border-radius: 8px; font-weight: 500; font-size: 0.85rem;
}

/* ---- Section Headings ---- */
.section-title {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700; position: relative; display: inline-block;
}
.section-title::after {
    content: ''; position: absolute;
    bottom: -6px; left: 0;
    width: 50px; height: 3px;
    background: var(--primary); border-radius: 2px;
}

/* ---- Breadcrumb ---- */
.breadcrumb-area { background: #fff; padding: 12px 0; border-bottom: 1px solid #eee; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; font-size: 0.85rem; }
.breadcrumb-item.active { font-size: 0.85rem; }

/* ---- Filter Sidebar ---- */
.filter-card { border: none; border-radius: 12px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.filter-card .card-header { background: var(--primary); color: #fff; border-radius: 12px 12px 0 0 !important; font-weight: 600; }
.price-range input[type=range] { accent-color: var(--primary); }

/* ---- Product Detail ---- */
.product-gallery img { border-radius: 12px; object-fit: cover; width: 100%; }
.product-gallery .thumb { cursor: pointer; border-radius: 8px; border: 2px solid transparent; transition: border-color 0.2s; height: 70px; object-fit: cover; }
.product-gallery .thumb:hover, .product-gallery .thumb.active { border-color: var(--primary); }
.size-btn input:checked + label { background: var(--primary); color: #fff; border-color: var(--primary); }
.size-btn label { cursor: pointer; min-width: 44px; text-align: center; border-radius: 6px; font-size: 0.85rem; }
.color-btn input:checked + label { outline: 3px solid var(--primary); outline-offset: 2px; }
.color-btn label { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid #ddd; display: inline-block; }
.qty-control { width: 140px; }
.qty-control .form-control { text-align: center; }

/* ---- Cart ---- */
.cart-item-img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; }
.cart-table td { vertical-align: middle; }
.order-summary-card { border: none; border-radius: 14px; background: #fff; box-shadow: 0 2px 16px rgba(0,0,0,0.08); }

/* ---- Checkout ---- */
.checkout-step { padding: 8px 16px; border-radius: 30px; font-size: 0.85rem; font-weight: 600; }
.checkout-step.active { background: var(--primary); color: #fff; }
.checkout-step.done { background: #27ae60; color: #fff; }
.checkout-step.pending { background: #dee2e6; color: #666; }

/* ---- Auth Pages ---- */
.auth-card { border: none; border-radius: 20px; box-shadow: 0 8px 40px rgba(0,0,0,0.12); }
.auth-card .card-header { border-radius: 20px 20px 0 0 !important; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }

/* ---- Order Status Badge ---- */
.status-pending   { background: #ffc107; color: #000; }
.status-confirmed { background: #17a2b8; color: #fff; }
.status-processing{ background: #6f42c1; color: #fff; }
.status-shipped   { background: #fd7e14; color: #fff; }
.status-delivered { background: #28a745; color: #fff; }
.status-cancelled { background: #dc3545; color: #fff; }

/* ---- Admin ---- */
.admin-sidebar { width: 250px; min-height: 100vh; background: #1a1a2e; }
.admin-sidebar .nav-link { color: rgba(255,255,255,0.7); padding: 10px 20px; border-radius: 8px; margin: 2px 8px; font-size: 0.9rem; }
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active { background: var(--primary); color: #fff; }
.admin-sidebar .nav-link i { width: 20px; }
.admin-content { flex: 1; background: #f1f3f5; }
.admin-stat-card { border: none; border-radius: 14px; overflow: hidden; }
.admin-stat-card .card-body { padding: 20px; }

/* ---- Wishlist Heart ---- */
.wishlist-btn.wishlisted i { color: var(--secondary); }

/* ---- Toast / Alert ---- */
.toast-container { z-index: 9999; }

/* ---- Utilities ---- */
.hover-primary:hover { color: var(--primary) !important; }
.rounded-xl { border-radius: 14px !important; }
.shadow-soft { box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important; }

/* ---- No-image placeholder ---- */
.no-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    color: #aaa; font-size: 3rem;
}

/* ---- Back to top ---- */
#backToTop { opacity: 0.8; transition: opacity 0.2s; }
#backToTop:hover { opacity: 1; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero-carousel .carousel-item { height: 320px; }
    .product-card .card-img-wrap { height: 200px; }
    .category-card { height: 150px; }
}
