/* =======================================
   GLOBAL STYLES
======================================= */
body {
    font-family: Arial, sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
    color: #111;
}

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

.product-page {
    background: #f5f5f5;
    padding: 20px 0;
}

/* =======================================
   PRODUCT DETAIL LAYOUT
======================================= */
.product-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.product-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    background: #fff;
    padding: 20px;
    border-radius: 6px;
}

@media (max-width: 1024px) {
    .product-layout {
        flex-direction: column;
    }
}

/* -----------------------
   LEFT COLUMN - GALLERY
------------------------ */
.product-gallery {
    flex: 1 1 350px;
}

.main-image-wrapper {
    overflow: hidden;
    position: relative;
}

.main-media {
    width: 100%;
    display: block;
    transition: transform 0.2s ease, opacity 0.25s ease;
    transform-origin: center center;
}

.fade-out {
    opacity: 0;
}

/* Hover zoom */
.main-image-wrapper img:hover {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

/* Thumbnails */
.thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.thumbnails .thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnails .thumb.active {
    border-color: #ff9900;
    /* Amazon-style highlight */
}

.video-thumb {
    background: #000;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
}

/* -----------------------
   MIDDLE COLUMN - INFO
------------------------ */
.product-info {
    flex: 1 1 400px;
}

.product-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.product-brand,
.product-category {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
}

.product-price-block {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.product-price-sale {
    color: #b12704;
    font-weight: bold;
    margin-right: 10px;
}

.product-price-original {
    text-decoration: line-through;
    color: #888;
}

/* Stock messages */
.product-stock {
    margin-bottom: 15px;
}

.in-stock {
    color: #007600;
    font-weight: 600;
}

.low-stock {
    color: #b12704;
    font-weight: 600;
}

.out-stock {
    color: #b12704;
    font-weight: 600;
}

/* Description */
.product-description {
    margin-top: 20px;
}

/* Specifications */
.product-specifications {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.product-specifications h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.5rem;
}

.product-specifications ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-specifications li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    color: #555;
}

.product-specifications li:last-child {
    border-bottom: none;
}

.product-specifications li strong {
    color: #333;
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .product-specifications li {
        flex-direction: column;
        align-items: flex-start;
        font-size: 0.9rem;
    }

    .product-specifications li strong {
        display: block;
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 480px) {
    .product-specifications h2 {
        font-size: 1.1rem;
    }

    .product-specifications li {
        font-size: 0.85rem;
    }
}

/* -----------------------
   RIGHT COLUMN - BUY BOX
------------------------ */
.product-buybox {
    flex: 0 0 250px;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    height: fit-content;
    position: sticky;
    top: 100px;
    /* adjust based on header height */
    background-color: #fff;
}

.buybox-price,
.buybox-sale {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.buybox-stock {
    margin-bottom: 15px;
}

.buybox-button {
    width: 100%;
    background: #ffd814;
    border: 1px solid #fcd200;
    border-radius: 22px;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
}

.buybox-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.buybox-button {
    position: relative;
    z-index: 10;
}

/* Quantity controls */
.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-control input {
    width: 60px;
    text-align: center;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.qty-btn:hover {
    background-color: #eaeaea;
}

.qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .product-buybox {
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        z-index: 1000;
    }
}

/* -----------------------
   RESPONSIVE ADJUSTMENTS
------------------------ */
@media (max-width: 1024px) {
    .product-buybox {
        flex: 1 1 auto;
        margin-top: 20px;
    }
}

/* =========================
   Buybox Messages
   ========================= */
.buybox-messages {
    margin-top: 10px;
}

.buybox-message {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Success */
.buybox-message.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* Error */
.buybox-message.error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}