/* ============================================================
   ShopVibe — Custom Stylesheet
   Modern, clean e-commerce design with premium aesthetics
   ============================================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg-light: #f8fafc;
    --bg-body: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --font-family: 'Inter', -apple-system, system-ui, sans-serif;
}

/* ---------- Base Styles ---------- */
body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background: var(--bg-body);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Top Bar ---------- */
.top-bar {
    background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%);
    color: #fff;
    font-size: 0.8rem;
    padding: 6px 0;
}

.top-bar a {
    color: #cbd5e1;
    transition: var(--transition);
}

.top-bar a:hover {
    color: #fff;
}

/* ---------- Navbar ---------- */
.navbar {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    z-index: 1040;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    padding: 8px 16px !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary) !important;
    background: rgba(79, 70, 229, 0.05);
}

.search-form .form-control {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border: 2px solid var(--border-color);
    padding: 8px 14px;
    font-size: 0.9rem;
}

.search-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: none;
}

.search-form .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-icons a {
    color: var(--text-dark);
}

.cart-icon {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 50%;
}

/* ---------- Hero Banner / Swiper ---------- */
.hero-slider {
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.hero-slide {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-color: var(--secondary);
}

.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15,23,42,0.85) 0%, rgba(15,23,42,0.3) 70%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 550px;
    padding: 0 15px;
}

.hero-content h1 {
    color: #fff;
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-content p {
    color: #cbd5e1;
    font-size: 1.15rem;
    margin-bottom: 24px;
}

.hero-slider .swiper-pagination-bullet-active {
    background: var(--primary);
}

.hero-slider .swiper-button-next,
.hero-slider .swiper-button-prev {
    color: #fff;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.hero-slider .swiper-button-next::after,
.hero-slider .swiper-button-prev::after {
    font-size: 18px;
}

/* ---------- Section Headers ---------- */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 1.8rem;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.section-header p {
    color: var(--text-muted);
    margin-top: 8px;
}

/* ---------- Product Cards ---------- */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    background: #fff;
    height: 100%;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-light);
}

.product-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

.product-card .card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .card-overlay {
    opacity: 1;
}

.card-overlay .btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: var(--text-dark);
    border: none;
    font-size: 1rem;
    transform: translateY(10px);
    transition: var(--transition);
}

.product-card:hover .card-overlay .btn {
    transform: translateY(0);
}

.card-overlay .btn:hover {
    background: var(--primary);
    color: #fff;
}

.product-card .card-body {
    padding: 16px;
}

.product-card .product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.product-card .product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-title a {
    color: inherit;
}

.product-card .product-title a:hover {
    color: var(--primary);
}

.product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.product-card .product-price .original-price {
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: line-through;
    font-weight: 400;
    margin-left: 6px;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-sale { background: var(--danger); color: #fff; }
.badge-new { background: var(--success); color: #fff; }
.badge-featured { background: var(--accent); color: #fff; }

/* ---------- Category Cards ---------- */
.category-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--bg-light);
    text-align: center;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(15,23,42,0.8) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.category-card .overlay h5 {
    color: #fff;
    font-size: 1rem;
    margin: 0;
}

/* ---------- Promo Section ---------- */
.promo-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 60px 0;
    color: #fff;
    text-align: center;
}

.promo-section h2 {
    color: #fff;
    font-size: 2rem;
}

.promo-section p {
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 12px auto 24px;
}

/* ---------- Buttons ---------- */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 10px 24px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 10px 24px;
}

.btn-accent:hover {
    background: #d97706;
    color: #fff;
}

/* ---------- Shop Page ---------- */
.shop-sidebar .filter-group {
    margin-bottom: 24px;
}

.shop-sidebar .filter-group h6 {
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.shop-sidebar .form-check {
    margin-bottom: 6px;
}

.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sort-bar .results-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Product Detail Page ---------- */
.product-gallery {
    position: sticky;
    top: 100px;
}

.product-gallery .main-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-light);
    margin-bottom: 12px;
}

.product-gallery .main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery .thumbnails {
    display: flex;
    gap: 8px;
}

.product-gallery .thumb {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.product-gallery .thumb.active,
.product-gallery .thumb:hover {
    border-color: var(--primary);
}

.product-gallery .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info .product-name {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.product-info .product-price-lg {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.product-info .original-price-lg {
    font-size: 1.1rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 8px;
}

.product-info .discount-badge {
    background: var(--danger);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
}

.product-info .stock-in {
    color: var(--success);
    font-weight: 600;
}

.product-info .stock-out {
    color: var(--danger);
    font-weight: 600;
}

.qty-group {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.qty-group button {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-light);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.qty-group button:hover {
    background: var(--primary);
    color: #fff;
}

.qty-group input {
    width: 50px;
    height: 40px;
    text-align: center;
    border: none;
    font-weight: 600;
    font-size: 1rem;
}

.qty-group input:focus {
    outline: none;
}

.product-tabs .nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.product-tabs .nav-link {
    font-weight: 600;
    color: var(--text-muted) !important;
    border: none;
    padding: 12px 20px !important;
    border-bottom: 2px solid transparent;
    background: transparent !important;
    margin-bottom: -2px;
}

.product-tabs .nav-link.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary);
}

.product-tabs .tab-content {
    padding: 24px 0;
}

.spec-table td {
    padding: 10px 16px;
}

.spec-table tr:nth-child(even) {
    background: var(--bg-light);
}

/* ---------- Cart Page ---------- */
.cart-table {
    width: 100%;
}

.cart-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 12px 16px;
    color: var(--text-muted);
}

.cart-table td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.cart-table .cart-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-table .cart-product img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.cart-summary {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 24px;
}

.cart-summary h5 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.cart-summary .summary-total {
    font-size: 1.2rem;
    font-weight: 700;
    border-top: 2px solid var(--border-color);
    padding-top: 12px;
    margin-top: 8px;
}

/* ---------- Checkout ---------- */
.checkout-section .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.checkout-section .form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.checkout-section .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.order-confirm-box {
    text-align: center;
    padding: 40px;
}

.order-confirm-box .check-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ---------- Auth Pages ---------- */
.auth-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 40px 0;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

.auth-card h2 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* ---------- Dashboard ---------- */
.dashboard-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px !important;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    color: var(--text-dark) !important;
    font-weight: 500;
}

.dashboard-nav .nav-link.active {
    background: var(--primary) !important;
    color: #fff !important;
}

.dashboard-nav .nav-link:hover:not(.active) {
    background: var(--bg-light);
}

.order-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-shipped { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--secondary);
    color: #94a3b8;
}

.footer-brand {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-heading {
    color: #fff;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
    margin-right: 6px;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
}

.payment-icon {
    height: 24px;
    margin-left: 4px;
    opacity: 0.7;
}

/* ---------- Misc ---------- */
.breadcrumb-custom {
    background: var(--bg-light);
    padding: 14px 0;
    margin-bottom: 30px;
}

.breadcrumb-custom .breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-custom .breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-custom .breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 600;
}

.no-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 3rem;
    border-radius: var(--radius-md);
}

/* ---------- Loading spinner ---------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .hero-slide {
        height: 350px;
    }
    .hero-content h1 {
        font-size: 1.8rem;
    }
    .search-form {
        margin: 12px 0;
    }
}

@media (max-width: 767px) {
    .hero-slide {
        height: 280px;
    }
    .hero-content h1 {
        font-size: 1.5rem;
    }
    .hero-content p {
        font-size: 0.9rem;
    }
    .section-header h2 {
        font-size: 1.4rem;
    }
    .product-info .product-name {
        font-size: 1.3rem;
    }
    .cart-table .d-none-mobile {
        display: none;
    }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
