/* === GLOBAL STYLES & VARIABLES === */
:root {
    --blue: #0096da;
    --yellow: #FFC107;
    --dark: #073f5f;
    --light: #f9fbfc;
    --light-alt: #f1f5f9;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--light-alt);
    color: #222;
}

/* === HEADER === */
#top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.brand {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
}

/* === SHOP LAYOUT === */
.shop-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    padding: 30px;
    max-width: 1400px;
    margin: auto;
    align-items: flex-start;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#view-title {
    color: var(--dark);
}

#back-to-categories {
    background: none;
    border: none;
    color: var(--blue);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

#grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* === CARD STYLES (Categories & Products) === */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.card-content p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
}

.card-footer {
    margin-top: auto;
    padding: 0 15px 15px;
}

/* Product-specific card styles */
.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 15px;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: var(--yellow);
    color: #000;
    border: none;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.add-to-cart-btn:hover {
    transform: scale(1.05);
}

.category-card {
    cursor: pointer;
}

/* === CART SIDEBAR === */
#cart-sidebar {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    position: sticky;
    top: 100px; /* Offset for sticky header */
}

#cart-sidebar h3 {
    color: var(--dark);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.cart-empty-msg {
    color: #777;
    text-align: center;
    padding: 40px 0;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.cart-item-price {
    font-size: 0.85rem;
    color: #666;
}

.cart-item-remove {
    background: none;
    border: none;
    font-size: 1rem;
    color: #999;
    cursor: pointer;
}

.cart-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

#checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#checkout-btn:hover {
    transform: scale(1.05);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 992px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    #cart-sidebar {
        position: static; /* Cart is no longer sticky */
    }
}

@media (max-width: 576px) {
    .shop-layout {
        padding: 15px;
    }

    .brand {
        font-size: 1.2rem;
    }

    .header-title {
        display: none;
    }
}