/* ===== Base ===== */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f9f9fb;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Product Page ===== */
.product-page {
    padding: 4rem 0;
}

.product-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
    align-items: flex-start;
}

/* ----- Product Image ----- */
.product-image-wrapper {
    flex: 1 1 45%;
    max-width: 450px;
    text-align: center;
}

.product-image {
    width: 100%;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-image:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ----- Product Info ----- */
.product-info {
    flex: 1 1 50%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.product-name {
    font-size: 2.8rem;
    font-weight: 700;
    color: #2e3192;
}

.product-desc {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2e3192;
    margin: 0.5rem 0 1rem 0;
}

.price-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-old {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
}

.badge-sale {
    background-color: #ffdd00;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

/* ----- Stock Info ----- */
.stock-status {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 1rem;
}

.stock-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
}

.in-stock .stock-badge {
    background-color: #28a745;
    color: #fff;
}

.out-of-stock .stock-badge {
    background-color: #dc3545;
    color: #fff;
}

/* ----- Purchase Section ----- */
.purchase-section {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Quantity Box */
.quantity-box {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-size: 1rem;
    outline: none;
}

.quantity-box:focus {
    border-color: #2e3192;
    box-shadow: 0 0 0 2px rgba(46, 49, 146, 0.2);
}

/* Add to Cart Button */
.btn-add-cart {
    padding: 0.8rem 1.8rem;
    background-color: #2e3192;
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    background-color: #ffdd00;
    color: #2e3192;
    transform: translateY(-1px);
}

.btn-add-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    color: #666;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .product-detail {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .product-detail {
        flex-direction: column;
        align-items: center;
    }

    .product-info {
        text-align: center;
        align-items: center;
        width: 100%;
    }

    .product-image-wrapper {
        flex: 1 1 80%;
    }

    .stock-status {
        justify-content: center;
    }

    /* Keep quantity and button side by side on tablet/mobile */
    .purchase-section {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        width: 100%;
    }

    .quantity-box {
        width: 70px;
        flex-shrink: 0;
    }

    .btn-add-cart {
        flex-shrink: 1;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .product-name { font-size: 2rem; }
    .product-desc { font-size: 1rem; }
    .product-price { font-size: 1.5rem; }

    .purchase-section {
        flex-direction: row; /* horizontal */
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem;
        width: 100%;
    }

    .quantity-box {
        width: 60px;
    }

    .btn-add-cart {
        flex: 1; /* take remaining space */
        max-width: none;
    }
}
