* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f6f8;
    color: #222;
}

header {
    background: white;
    padding: 16px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.cart-button {
    width: auto;
    padding: 10px 15px;
}

#cart-count {
    background: #222;
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
}

main {
    max-width: 1100px;
    margin: auto;
    padding: 20px;
}

.hero {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.hero h1 {
    margin-top: 0;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.controls input,
.controls select {
    padding: 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.controls input {
    flex: 1;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.product {
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.product-image {
    height: 180px;
    background: #f1f1f1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.product-placeholder {
    font-size: 55px;
}

.product h3 {
    min-height: 42px;
    margin: 5px 0;
}

.category {
    color: #777;
    font-size: 13px;
}

.price {
    font-size: 20px;
    font-weight: bold;
    margin: 12px 0;
}

button {
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 8px;
    background: #222;
    color: white;
    font-size: 15px;
    cursor: pointer;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    opacity: 0;
    visibility: hidden;
    z-index: 20;
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: fixed;
    right: -420px;
    top: 0;
    width: min(420px, 92%);
    height: 100vh;
    background: white;
    z-index: 30;
    transition: .25s;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0,0,0,.15);
}

.cart-panel.open {
    right: 0;
}

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

.cart-header h2 {
    margin: 0;
}

.close-cart {
    width: auto;
    background: transparent;
    color: #222;
    font-size: 20px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.cart-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cart-item-info span {
    color: #777;
    font-size: 14px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.quantity-controls button {
    width: 36px;
    padding: 8px;
}

.remove-button {
    width: auto;
    margin-top: 10px;
    background: transparent;
    color: #c00;
    padding: 4px;
}

.cart-footer {
    border-top: 1px solid #eee;
    padding: 18px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    margin-bottom: 15px;
}

.checkout-button {
    padding: 14px;
}

.empty-cart {
    text-align: center;
    color: #777;
    margin-top: 40px;
}

@media (max-width: 600px) {
    main {
        padding: 12px;
    }

    .controls {
        flex-direction: column;
    }

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

    .product {
        padding: 12px;
    }

    .product-image {
        height: 130px;
    }
}

.logo {
    text-decoration: none;
    color: inherit;
}

.back-button {
    text-decoration: none;
    color: #222;
}

.product-detail {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    margin-top: 20px;
}

.product-detail-image {
    min-height: 350px;
    background: #f1f1f1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-detail-info h1 {
    font-size: 32px;
    margin: 10px 0;
}

.detail-price {
    font-size: 28px;
    font-weight: bold;
    margin: 15px 0;
}

.product-detail-info p {
    color: #666;
    line-height: 1.6;
}

@media (max-width: 600px) {

    .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }

    .product-detail-image {
        min-height: 250px;
    }

    .product-detail-info h1 {
        font-size: 25px;
    }

}

.checkout {
    max-width: 600px;
    margin: 30px auto;
    background: white;
    padding: 25px;
    border-radius: 15px;
}

.checkout h1 {
    margin-top: 0;
}

.checkout label {
    display: block;
    margin-bottom: 18px;
    font-weight: bold;
}

.checkout input,
.checkout textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

.checkout textarea {
    min-height: 110px;
    resize: vertical;
}

.checkout-summary {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 18px 0;
    margin: 20px 0;
}

.checkout-summary div {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.order-success {
    text-align: center;
    padding: 30px 10px;
}

.order-success a {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
}


.admin {
    max-width: 900px;
    margin: 25px auto;
}

.order-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.order-header h2 {
    margin: 0 0 5px;
}

.order-status {
    background: #eee;
    padding: 7px 12px;
    border-radius: 20px;
}

.customer-info {
    line-height: 1.5;
    margin: 15px 0;
}

.order-items {
    border-top: 1px solid #eee;
}

.admin-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    padding: 18px 0;
}

.status-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-controls button {
    width: auto;
    padding: 9px 14px;
}

.admin-empty {
    background: white;
    padding: 30px;
    text-align: center;
    border-radius: 12px;
}

@media (max-width: 600px) {

    .admin {
        margin: 15px 10px;
    }

    .order-header {
        align-items: flex-start;
        gap: 10px;
    }

    .admin-item {
        grid-template-columns: 1fr auto;
    }

    .admin-item strong {
        grid-column: 2;
    }

}

