/* Purchase Modal Styles */

.purchase-modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    pointer-events: none;
}

.purchase-modal.show {
    display: block;
    pointer-events: all;
}

.purchase-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.purchase-modal.show .purchase-modal-overlay {
    opacity: 1;
}

.purchase-modal-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: inherit;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.purchase-modal.show .purchase-modal-content {
    transform: translateY(0);
}

.purchase-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
}

.purchase-modal-close:hover {
    color: #333;
}

.purchase-modal-body {
    display: flex;
    gap: 15px;
    padding-top: 10px;
}

.purchase-product-thumbnail {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

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

.expand-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
}

.expand-image-btn:hover {
    background: white;
}

.purchase-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.purchase-price-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.purchase-current-price {
    font-size: 22px;
    color: #ee4d2d;
    font-family: 'ShopeeFont2', sans-serif;
}

.purchase-original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.purchase-stock {
    font-size: 13px;
    color: #666;
}

.purchase-variations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.purchase-variations label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.variation-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.variation-option {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    min-width: 100px;
}

.variation-option:hover {
    border-color: #ee4d2d;
}

.variation-option.selected {
    border-color: #ee4d2d;
    background: #fff5f3;
}

.variation-option.selected::before {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ee4d2d;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.variation-option-image {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 5px;
    display: block;
}

.variation-option-placeholder {
    width: 100%;
    height: 60px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #999;
}

.variation-option-name {
    font-size: 12px;
    color: #333;
    text-align: center;
}

.purchase-quantity {
    display: flex;
    gap: 8px;
    align-items: center;
    gap: 50px;
}

.purchase-quantity label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    width: fit-content;
    overflow: hidden;
}

.quantity-btn {
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    transition: background 0.2s;
}

.quantity-btn:hover {
    background: #f5f5f5;
}

.quantity-btn:active {
    background: #e0e0e0;
}

#quantityInput {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: white;
    -moz-appearance: textfield;
}

#quantityInput::-webkit-outer-spin-button,
#quantityInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.purchase-buy-btn {
    width: 100%;
    padding: 9px;
    background: #ee4d2d;
    color: white;
    border: none;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.purchase-buy-btn:hover {
    background: #d7321f;
}

.purchase-buy-btn:active {
    background: #c02a18;
}

/* Responsive */
@media (max-width: 768px) {
    .purchase-modal-content {
        border-radius: inherit;
        padding: 15px;
    }

    .purchase-modal-body {
        flex-direction: column;
        gap: 15px;
    }

    .purchase-product-thumbnail {
        width: 100px;
        height: 100px;
    }

    .variation-options {
        gap: 8px;
    }

    .variation-option {
        min-width: 90px;
    }

    .variation-option-image {
        height: 50px;
    }
}

