/* ========================================
   CSS Reset & Root Variables
   ======================================== */

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

:root {
    --primary-color: #0a0e27;
    --secondary-color: #6366f1;
    --accent-color: #ec4899;
    --light-gray: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========================================
   Navigation Bar
   ======================================== */

.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

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

.logo i {
    color: var(--secondary-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    position: relative;
    display: none;
}

.search-box input {
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: var(--radius);
    width: 200px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.cart-btn:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a1f3a 100%);
    color: white;
    padding: 6rem 1rem;
    text-align: center;
    margin-bottom: 3rem;
}

.hero-content h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hero-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.cta-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
}

/* ========================================
   Filters Section
   ======================================== */

.filters-section {
    padding: 2rem 0;
    background: var(--light-gray);
}

.filters {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.filter-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* ========================================
   Products Section
   ======================================== */

.products-section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.6s ease-in;
}

/* Loading Skeleton */
.loading-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.skeleton-card {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
    height: 300px;
}

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

/* Product Card */
.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.6s ease-in;
}

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

.product-image {
    width: 100%;
    height: 220px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-category {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    text-transform: capitalize;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.stars {
    color: #fbbf24;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.add-to-cart-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    background: var(--accent-color);
}

.no-results {
    text-align: center;
    padding: 4rem 1rem;
}

.no-results i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ========================================
   Product Modal
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 101;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--light-gray);
}

.modal-body {
    padding: 3rem;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.detail-image {
    width: 100%;
    height: 400px;
    background: var(--light-gray);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.detail-price {
    font-size: 1.8rem;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    font-family: 'Poppins', sans-serif;
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.detail-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.detail-specs {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.spec {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.spec:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 600;
    color: var(--text-primary);
}

.spec-value {
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    gap: 1rem;
}

.qty-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 120px;
}

.qty-input button {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
}

.qty-input button:hover {
    color: var(--secondary-color);
}

.qty-input input {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.qty-input input:focus {
    outline: none;
}

.add-cart-modal-btn {
    flex: 1;
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.add-cart-modal-btn:hover {
    background: var(--accent-color);
}

/* ========================================
   Cart Sidebar
   ======================================== */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 99;
    display: flex;
    flex-direction: column;
    transition: right 0.4s ease-out;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.cart-close:hover {
    color: var(--text-primary);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-in;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.cart-item-price {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.remove-item-btn:hover {
    transform: scale(1.2);
}

.cart-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0 0 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.checkout-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.checkout-btn:hover {
    background: var(--accent-color);
}

.clear-cart-btn {
    background: white;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.clear-cart-btn:hover {
    background: #fef2f2;
}

/* ========================================
   Overlay
   ======================================== */

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
}

.overlay.active {
    display: block;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .navbar-container {
        height: 60px;
    }

    .search-box {
        display: none !important;
    }

    .hero {
        padding: 4rem 1rem;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .product-image {
        height: 180px;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .detail-image {
        height: 300px;
    }

    .modal-body {
        padding: 2rem 1.5rem;
    }

    .detail-actions {
        flex-direction: column;
    }

    .qty-input {
        width: 100%;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .navbar-container {
        padding: 0 0.75rem;
        height: 55px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo span {
        display: none;
    }

    .nav-right {
        gap: 1rem;
    }

    .hero {
        padding: 3rem 0.75rem;
        margin-bottom: 2rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .cta-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .filters {
        gap: 0.75rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .product-price {
        font-size: 1.1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-header p {
        font-size: 0.9rem;
    }

    .products-section {
        padding: 2rem 0;
    }

    .modal-content {
        width: 95%;
        border-radius: 12px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .modal-body {
        padding: 1.5rem 1rem;
    }

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

    .detail-price {
        font-size: 1.5rem;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .cart-header {
        padding: 1rem;
    }

    .cart-items {
        padding: 1rem;
    }

    .cart-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cart-footer {
        padding: 1rem;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.fade-in {
    animation: fadeIn 0.6s ease-in;
}
