@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #ec4899;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    margin: 0; padding: 0;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    display: flex; flex-direction: column; min-height: 100vh;
    overflow-x: hidden;
}

/* Header & Top Bar */
.top-bar {
    background-color: var(--dark); color: var(--light);
    padding: 0.75rem 5%; font-size: 0.85rem;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.5rem;
}
@media (max-width: 768px) {
    .top-bar { justify-content: center; text-align: center; }
}

.header {
    background: var(--white); box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 100;
    padding: 1rem 5%;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem;
}
@media (max-width: 768px) {
    .header { padding: 1rem; flex-direction: column; justify-content: center; }
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-text {
    font-size: 1.75rem; font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

@media (max-width: 480px) {
    .logo-text { font-size: 1.5rem; }
}

.nav-links {
    display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; justify-content: center; width: 100%;
}
@media (min-width: 769px) {
    .nav-links { width: auto; }
}
@media (max-width: 480px) {
    .nav-links { gap: 1rem; font-size: 0.95rem; }
}

.nav-links a {
    text-decoration: none; color: var(--gray); font-weight: 500;
    transition: var(--transition); position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -4px; left: 0; background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem; border-radius: 8px; text-decoration: none;
    font-weight: 600; transition: var(--transition); cursor: pointer; border: none; gap: 0.5rem;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: var(--white) !important; box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79, 70, 229, 0.23); }

/* Layout & Containers */
.main-content { flex: 1; }
.container { max-width: 1280px; margin: 0 auto; padding: 2rem 5%; width: 100%; }
@media (max-width: 768px) {
    .container { padding: 1.5rem 5%; }
}

/* Grids */
.grid-shop { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; }
@media (max-width: 900px) { .grid-shop { grid-template-columns: 1fr; gap: 1.5rem; } }

.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
.product-actions { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.product-actions .btn, .product-actions form { width: 100%; }
.product-title { font-size: 1.1rem; }
.product-price { font-size: 1.2rem; }

@media (max-width: 480px) { 
    .grid-products { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; } 
    .card-body { padding: 0.75rem !important; }
    .product-title { font-size: 0.95rem; }
    .product-price { font-size: 0.95rem; margin-bottom: 0.5rem !important; }
    .product-actions { display: flex; flex-direction: column; gap: 0.35rem; }
    .product-actions .btn { font-size: 0.75rem; padding: 0.5rem; width: 100%; }
}

.price-original {
    text-decoration: line-through;
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 400;
}

.discount-badge {
    background: #fee2e2;
    color: #ef4444;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.grid-cart { display: flex; flex-direction: column; gap: 5rem; }

.grid-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
@media (max-width: 900px) { .grid-detail { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white); padding: 5rem 5%; text-align: center;
}
.hero-title { font-size: 3.5rem; margin-bottom: 1rem; color: white; }
.hero-subtitle { font-size: 1.25rem; max-width: 600px; margin: 0 auto 2rem; opacity: 0.9; }
@media (max-width: 768px) {
    .hero-section { padding: 3rem 5%; }
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1.05rem; }
}

/* Generic Page Header */
.page-header { background: var(--dark); color: var(--white); padding: 3rem 5%; text-align: center; }
.page-header h1 { margin: 0; color: white; font-size: 2.5rem; }
@media (max-width: 768px) {
    .page-header { padding: 2rem 5%; }
    .page-header h1 { font-size: 1.75rem; }
}

/* Cards */
.card {
    background: var(--white); border-radius: 12px; box-shadow: var(--shadow);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }

/* Tables */
.table-responsive { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
.table-cart { width: 100%; border-collapse: collapse; min-width: 500px; }
.table-cart th { padding: 1rem; text-align: left; }
.table-cart td { padding: 1rem; border-bottom: 1px solid var(--gray-light); }

/* Footer */
.footer { background: var(--dark); color: var(--gray-light); padding: 3rem 5% 1rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 2rem; padding-top: 1rem; text-align: center; font-size: 0.875rem; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.5s ease forwards; }

.item-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Non-Table Cart Layout */
.cart-list { display: flex; flex-direction: column; width: 100%; border-radius: 12px; overflow: hidden; }
.cart-header { 
    display: grid; grid-template-columns: 3fr 1.5fr 1fr 1.5fr 50px; gap: 1rem; 
    padding: 1.5rem; border-bottom: 2px solid var(--gray-light); 
    font-weight: 600; color: var(--gray); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px;
}
.cart-item { 
    display: grid; grid-template-columns: 3fr 1.5fr 1fr 1.5fr 50px; gap: 1rem; 
    padding: 1.5rem; border-bottom: 1px solid var(--gray-light); align-items: center; 
}
.cart-item:last-child { border-bottom: none; }

.cart-item-product { display: flex; align-items: center; gap: 1rem; }
.cart-item-img { flex-shrink: 0; width: 70px; height: 70px; background: var(--gray-light); border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-name { font-weight: 600; font-size: 1.1rem; color: var(--dark); }

.cart-item-qty { display: flex; justify-content: center; }
.cart-item-qty span { background: var(--light); padding: 0.3rem 0.8rem; border-radius: 6px; font-weight: 600; }
.cart-item-subtotal { font-weight: 700; color: var(--primary); text-align: right; }
.cart-item-action { text-align: right; }

@media (max-width: 768px) {
    .cart-header { display: none; }
    .cart-item { 
        display: flex; flex-direction: column; align-items: flex-start; 
        position: relative; padding: 1.5rem; gap: 0.75rem; 
    }
    .cart-item-product { width: 100%; margin-bottom: 0.5rem; padding-right: 2.5rem; }
    
    .cart-item-price, .cart-item-qty, .cart-item-subtotal { 
        display: flex; justify-content: space-between; align-items: center; width: 100%; 
    }
    .cart-item-price::before { content: "Price"; opacity: 0.6; font-size: 0.9rem; font-weight: 500; }
    .cart-item-qty::before { content: "Quantity"; opacity: 0.6; font-size: 0.9rem; font-weight: 500; }
    .cart-item-subtotal::before { content: "Subtotal"; opacity: 0.6; font-size: 0.9rem; font-weight: 500; }
    
    .cart-item-qty .qty-selector-wrapper { margin: 0 !important; }
    
    .cart-item-action {
        position: absolute; top: 1.5rem; right: 1.5rem;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    gap: 0.75rem;
    margin: 2rem 0;
}

.pagination .page-item {
    display: inline-block;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.pagination .page-item:not(.disabled) .page-link:hover {
    background-color: var(--primary);
    color: var(--white) !important;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.pagination .page-item.disabled .page-link {
    color: var(--gray-light) !important;
    background-color: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
    box-shadow: none;
}
