﻿/* _ProductBox.css - Load this file ONCE in your layout, not per product */

/* ===== Product Item Container ===== */
.product-item {
    background: #fff;
    border-radius: 20px;
    padding: 16px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: visible;
}

.product-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ===== Product Picture ===== */
.product-item .picture {
    background: transparent;
    border-radius: 0;
    padding: 6px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.product-item .picture img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.product-item .picture a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ===== Product Title ===== */
.product-item .product-title {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 2px 0 4px 0;
    line-height: 1.4;
}

.product-item .product-title a {
    color: #333;
    text-decoration: none;
}

/* ===== Quantity Block - Single Row Layout (Button LEFT, Qty RIGHT) ===== */
.qty-block {
    width: 100%;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* Center quantity controls when product is in cart (Add button hidden) */
.qty-block[data-in-cart="true"] {
    justify-content: center;
}

/* ===== Quantity Controls Container - Flyout Cart Style ===== */
.quantity {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

/* ===== Quantity Buttons - Flyout Cart Style ===== */
.quantity span {
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    width: 24px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    user-select: none;
}

.quantity .minus {
    background-color: #e8e8e8;
    color: #333;
    border-radius: 6px 0 0 6px;
}

.quantity .minus:hover {
    background-color: #d5d5d5;
}

.quantity .plus {
    background-color: #3498db;
    color: #fff;
    border-radius: 0 6px 6px 0;
}

.quantity .plus:hover {
    background-color: #2980b9;
}

/* Darker +/- when product is in cart */
.qty-block[data-in-cart="true"] .quantity .minus {
    background-color: #d0d0d0;
}
.qty-block[data-in-cart="true"] .quantity .minus:hover {
    background-color: #bfbfbf;
}
.qty-block[data-in-cart="true"] .quantity .plus {
    background-color: #2980b9;
}
.qty-block[data-in-cart="true"] .quantity .plus:hover {
    background-color: #1f6ca0;
}

.quantity span:active {
    transform: scale(0.95);
}

/* ===== Product Box Add to Cart Button ===== */
.product-box-add-to-cart-button {
    flex: 1;
    padding: 0 16px;
    margin: 0 !important;
    height: 32px;
    line-height: 32px !important;
    cursor: pointer;
    border: none;
    background-color: #f0f0f0;
    color: #666;
    border-radius: 12px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    float: none;
    white-space: nowrap;
}

.product-box-add-to-cart-button:hover {
    background-color: #e0e0e0;
    color: #333;
}

.input-box {
    width: 32px;
    text-align: center;
    border: none;
    padding: 4px 2px;
    font-size: 12px;
    font-weight: 500;
    outline: none;
    height: 32px !important;
    background: #fff;
    color: #333;
    flex-shrink: 0;
}

/* Hide the number input spin buttons */
.input-box::-webkit-inner-spin-button,
.input-box::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity .input-box[type="number"] {
    -moz-appearance: textfield;
}

/* ===== Price Display ===== */
.prices {
    margin: 4px 0;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    flex-direction: row-reverse;
}

.price-value {
    font-size: 16px;
    font-weight: 500;
    color: #000;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.price-label {
    font-size: 13px;
    color: #006299;
    font-weight: 500;
}

.old-price-value {
    font-size: 12px;
    color: #4e4e4e;
    text-decoration: line-through;
    font-weight: 500;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.old-price-label {
    font-size: 13px;
    color: #4e4e4e;
    font-weight: 500;
}

/* Hide old price styling classes */
/*.old-product-price,
.normal-product-price,
.memberclubprice,
.discountedprice {
    display: none;
}
*/

/* Product Attributes */
.product-attributes {
    display: none; /* Hide for cleaner design */
}

.attr-label,
.sku-label {
    font-weight: 600;
    margin-left: 4px;
}

/* ===== Product Badges - Top Left Position ===== */
.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 6px;
    z-index: 0;
}

.product-badges li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.product-badges img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.product-badges img:hover {
    transform: scale(1.15);
}

/* Product Info Container */
.product-info-container {
    display: none; /* Hide short description and attributes */
}

/* Club Price Styling */
.club-price {
    color: #2d9f5d;
}

/* Product KG Widget - Keep visible but minimal */
.product-kg-widget {
    text-align: center;
    margin: 4px 0;
    font-size: 12px;
}

/* Tax/Shipping Info */
.tax-shipping-info {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.tax-shipping-info a {
    color: #999;
    text-decoration: underline;
}

/* Base Price (PAngV) */
.base-price-pangv {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* SKU Display */
.sku {
    display: none; /* Hide for cleaner design */
}

/* Product Rating */
.product-rating-box {
    display: none; /* Hide for cleaner design */
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .product-item {
        padding: 12px;
        border-radius: 16px;
    }

    .product-item .picture {
        min-height: 140px;
        padding: 4px;
        margin-bottom: 3px;
    }

    .product-item .product-title {
        font-size: 14px;
        margin: 2px 0 3px 0;
    }

    .product-badges {
        gap: 5px;
        top: 8px;
        left: 8px;
    }

    .product-badges img {
        width: 42px;
        height: 42px;
    }

    /* ── Price: single centered line, no labels ── */
    .prices {
        display: flex;
        justify-content: right;
        align-items: baseline;
        gap: 8px;
        margin: 6px 0;
    }

    .price-row {
        margin-bottom: 0;
        justify-content: center;
    }

    .price-label,
    .old-price-label {
        display: none;
    }

    .price-value {
        font-size: 17px;
        font-weight: 700;
        color: #222;
    }

    .old-price-value {
        font-size: 14px;
        color: #aaa;
    }

    /* ── Qty block: keep horizontal row-reverse like desktop ── */
    .qty-block {
        flex-direction: row-reverse;
        align-items: center;
        gap: 6px;
        margin-top: 6px;
    }

    /* ── Quantity: keep compact like desktop ── */
    .quantity {
        border-radius: 8px;
        gap: 0;
    }

    .quantity span {
        width: 24px;
        height: 30px;
        font-size: 14px;
    }

    .quantity .minus {
        border-radius: 6px 0 0 6px;
    }

    .quantity .plus {
        border-radius: 0 6px 6px 0;
    }

    .input-box {
        width: 30px;
        font-size: 12px;
        font-weight: 500;
        height: 30px !important;
    }

    /* ── Button: compact like desktop ── */
    .product-box-add-to-cart-button {
        height: 30px;
        line-height: 30px !important;
        padding: 0 12px;
        font-size: 13px;
        font-weight: 600;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .product-item {
        padding: 10px;
    }

        .product-item .picture {
            min-height: 120px;
            padding: 4px;
            margin-bottom: 2px;
        }

        .product-item .product-title {
            margin: 1px 0 2px 0;
        }

    .product-badges {
        gap: 4px;
        top: 6px;
        left: 6px;
    }

        .product-badges img {
            width: 36px;
            height: 36px;
        }

    .prices {
        margin: 4px 0;
        gap: 6px;
    }

    .price-value {
        font-size: 15px;
    }

    .old-price-value {
        font-size: 12px;
    }

    .qty-block {
        gap: 4px;
        margin-top: 4px;
    }

    .quantity span {
        width: 22px;
        height: 28px;
        font-size: 13px;
    }

    .input-box {
        width: 26px;
        font-size: 12px;
        height: 28px !important;
    }

    .product-box-add-to-cart-button {
        height: 28px;
        line-height: 28px !important;
        padding: 0 10px;
        font-size: 12px;
        border-radius: 10px;
    }


}

/* ===== Details Section ===== */
.product-item .details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-item .add-info {
    margin-top: auto;
}
