/* ========================================
   1. GLOBAL STYLES
======================================== */

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

:root {
    --primary: #49372e;
    --primary-light: #765b45;
    --background: #f7f3ed;
    --surface: #ffffff;
    --surface-secondary: #f2e8dc;
    --border: #e6ddd2;
    --text: #302820;
    --text-light: #897d71;
    --success: #54865a;
    --danger: #b85c4b;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

button,
select {
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
}

img {
    display: block;
    max-width: 100%;
    object-fit: cover;
}

/* ========================================
   2. MAIN SHOP CONTAINER
======================================== */

.shop-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
}

/* ========================================
   3. CATEGORY NAVIGATION
======================================== */

.category-navigation {
    background-color: var(--surface);
    padding: 24px 28px;
    border-radius: 16px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.category-header {
    margin-bottom: 18px;
}

.category-header h1 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 4px;
}

.category-header p {
    font-size: 14px;
    color: var(--text-light);
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-btn {
    background-color: var(--surface-secondary);
    color: var(--primary);
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s ease;
}

.category-btn:hover,
.category-btn.active {
    background-color: var(--primary);
    color: white;
}

/* ========================================
   4. MAIN SHOP CONTENT
======================================== */

.shop-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 25px;
    align-items: start;
}

/* ========================================
   5. PRODUCT BOARD
======================================== */

.product-board {
    min-width: 0;
    background-color: var(--surface);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.product-board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.product-board-header h2 {
    font-size: 24px;
    color: var(--primary);
}

.product-board-header p {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

button:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.sort-container select {
    background-color: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--primary);
    cursor: pointer;
}

/* ========================================
   6. PRODUCT GRID
======================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* ========================================
   7. PRODUCT CARD
======================================== */

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(73, 55, 46, 0.1);
}

/* Product Image */

.product-image {
    height: 140px;
    overflow: hidden;
    position: relative;
    background-color: var(--surface-secondary);
}

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

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

/* Product Information */

.product-info {
    padding: 12px;
}

.product-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.product-title-row h3 {
    font-size: 15px;
    color: var(--primary);
}

.product-rating {
    color: #d69b35;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.product-description {
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.5;
    min-height: 42px;
    margin-bottom: 12px;
}

/* Product Price */

.product-price {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 15px;
}

.current-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

/* Add to Cart Button */

.add-to-cart-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 9px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

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

.add-to-cart-btn span {
    font-size: 18px;
    margin-right: 5px;
}

/* ========================================
   8. CART SIDEBAR
======================================== */

.cart-sidebar {
    position: sticky;
    top: 20px;
    background-color: var(--surface);
    padding: 22px;
    border-radius: 16px;
    border: 1px solid var(--border);
    min-width: 0;
}

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

.cart-header h2 {
    color: var(--primary);
    font-size: 21px;
}

.cart-header p {
    color: var(--text-light);
    font-size: 13px;
    margin-top: 3px;
}

.cart-count {
    font-weight: 700;
    color: var(--primary);
}

.cart-icon {
    font-size: 25px;
}

/* ========================================
   9. CART ITEMS
======================================== */

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
}

.cart-item {
    display: grid;
    grid-template-columns: 65px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.cart-item-image {
    width: 65px;
    height: 65px;
    border-radius: 10px;
}

.cart-item-info {
    min-width: 0;
}

.cart-item-info h3 {
    color: var(--primary);
    font-size: 14px;
    margin-bottom: 3px;
}

.cart-item-price {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 9px;
}

/* Quantity Controls */

.cart-item-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.quantity-btn {
    width: 27px;
    height: 27px;
    background-color: var(--surface-secondary);
    color: var(--primary);
    font-size: 16px;
    transition: 0.2s ease;
}

.quantity-btn:hover {
    background-color: var(--primary);
    color: white;
}

.quantity-value {
    min-width: 27px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

/* Remove Button */

.remove-item-btn {
    background: none;
    color: var(--danger);
    font-size: 12px;
    transition: 0.2s ease;
}

.remove-item-btn:hover {
    text-decoration: underline;
}

/* Item Subtotal */

.cart-item-subtotal {
    grid-column: 2;
    justify-self: end;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-top: -7px;
}

/* ========================================
   10. CART SUMMARY
======================================== */

.cart-summary h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.discount-row span:last-child {
    color: var(--success);
    font-weight: 600;
}

.summary-divider {
    border-top: 1px solid var(--border);
    margin: 15px 0;
}

.total-row {
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
}

.total-row strong {
    font-size: 21px;
}

/* Checkout Button */

.checkout-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 14px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    margin-top: 12px;
    transition: background-color 0.2s ease;
}

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

.checkout-note {
    color: var(--text-light);
    font-size: 11px;
    text-align: center;
    margin-top: 12px;
}

/* ========================================
   11. RESPONSIVE DESIGN
======================================== */

/* Tablets */

@media (max-width: 1100px) {
    .shop-content {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 18px;
    }

    .shop-container {
        padding: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-image {
        height: 160px;
    }

    .cart-sidebar {
        padding: 17px;
    }
}

/* Small Tablets */

@media (max-width: 800px) {
    .shop-content {
        grid-template-columns: 1fr;
    }

    .cart-sidebar {
        position: static;
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */

@media (max-width: 500px) {
    .shop-container {
        padding: 12px;
    }

    .category-navigation {
        padding: 18px;
    }

    .category-header h1 {
        font-size: 21px;
    }

    .category-list {
        gap: 8px;
    }

    .category-btn {
        padding: 9px 14px;
        font-size: 12px;
    }

    .product-board {
        padding: 15px;
    }

    .product-board-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-board-header h2 {
        font-size: 21px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 210px;
    }

    .cart-sidebar {
        padding: 18px;
    }
}
