/**
 * Variant Selector Modal Styles
 */

/* Modal Overlay */
.variant-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.variant-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Modal Content */
.variant-modal-content {
    position: relative;
    background: #fff;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.variant-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    color: #2d1f1f;
    transition: opacity 0.2s;
}

.variant-modal-close:hover {
    opacity: 0.7;
}

/* Modal Body - Two Column Layout */
.variant-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* Product Image */
.variant-modal-image {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.variant-modal-image img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

/* Product Info */
.variant-modal-info {
    padding: 40px 40px 40px 0;
}

.variant-modal-vendor {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 8px;
}

.variant-modal-title {
    font-family: 'ITC Garamond', Georgia, serif;
    font-size: 24px;
    font-weight: 300;
    line-height: 1.3;
    margin: 0 0 15px 0;
    color: #2d1f1f;
}

/* Price */
.variant-modal-price-wrapper {
    margin-bottom: 25px;
}

.variant-modal-price {
    font-size: 22px;
    font-weight: 600;
    color: #2d1f1f;
}

.variant-modal-price.has-discount {
    color: #f25c5e;
}

.variant-modal-compare-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
    display: none;
}

/* Variant Options */
.variant-modal-options {
    margin-bottom: 20px;
}

.variant-option-group {
    margin-bottom: 15px;
}

.option-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d1f1f;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-option {
    min-width: 50px;
    padding: 12px 18px;
    border: 1px solid #e5e5e5;
    background: #fff;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.size-option:hover:not(.unavailable):not(.selected) {
    border-color: #2d1f1f;
}

.size-option.selected {
    background: #2d1f1f;
    color: #fff;
    border-color: #2d1f1f;
}

.size-option.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.size-option.low-stock::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #f25c5e;
    border-radius: 50%;
    margin: 4px auto 0;
}

/* Quantity Selector */
.variant-modal-quantity {
    margin-bottom: 20px;
}

.quantity-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d1f1f;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    border: 1px solid #e5e5e5;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    color: #2d1f1f;
    transition: background 0.2s;
}

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

#variant-qty-input {
    width: 50px;
    height: 40px;
    border: none;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    text-align: center;
    font-size: 14px;
    font-family: inherit;
    -moz-appearance: textfield;
}

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

/* Stock Status */
.variant-modal-stock {
    font-size: 12px;
    margin-bottom: 15px;
    min-height: 18px;
}

.variant-modal-stock.in-stock {
    color: #28a745;
}

.variant-modal-stock.low-stock {
    color: #f25c5e;
}

.variant-modal-stock.out-of-stock {
    color: #dc3545;
}

/* Add to Cart Button */
.variant-modal-add-btn {
    width: 100%;
    padding: 18px;
    background: #2d1f1f;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.variant-modal-add-btn:hover:not(:disabled) {
    background: #1a1212;
}

.variant-modal-add-btn:disabled {
    background: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}

/* View Full Details Link */
.variant-modal-view-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    text-decoration: underline;
}

.variant-modal-view-link:hover {
    color: #2d1f1f;
}

/* Loading State */
.variant-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: #666;
}

.variant-modal-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e5e5;
    border-top-color: #2d1f1f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.variant-modal-error {
    text-align: center;
    padding: 30px;
    color: #f25c5e;
}

.variant-modal-error button {
    margin-top: 15px;
    padding: 10px 20px;
    background: #2d1f1f;
    color: #fff;
    border: none;
    cursor: pointer;
}

/* Add to Cart Button on Product Cards */
.product-card-wrapper {
    position: relative;
    background: #fff;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
}

/* Make the product link fill available space within the wrapper */
.product-card-wrapper > a.jsx-2594485245 {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

/* Image container fills middle space */
.product-card-wrapper .image-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Text wrapper stays at bottom */
.product-card-wrapper .text-wrapper {
    align-self: start;
    width: 100%;
    margin-top: auto;
}

.add-to-cart-btn {
    width: calc(100% - 30px);
    margin: 0 15px 15px;
    padding: 12px;
    background: transparent;
    border: 1px solid #2d1f1f;
    color: #2d1f1f;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Maison Neue', Arial, sans-serif;
}

.add-to-cart-btn:hover {
    background: #2d1f1f;
    color: #fff;
}

/* Price styles for product cards */
.price-container {
    margin-top: 8px;
}

.price-container .price {
    font-size: 14px;
    font-weight: 600;
    color: #2d1f1f;
}

.price-container .price.has-discount {
    color: #f25c5e;
}

.price-container .compare-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .variant-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .variant-modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .variant-modal-image {
        padding: 15px;
        max-height: 300px;
    }

    .variant-modal-image img {
        max-height: 250px;
    }

    .variant-modal-info {
        padding: 0 20px 30px;
    }

    .variant-modal-title {
        font-size: 20px;
    }

    .variant-modal-price {
        font-size: 20px;
    }

    .size-option {
        padding: 10px 14px;
        font-size: 13px;
    }

    .add-to-cart-btn {
        width: calc(100% - 20px);
        margin: 0 10px 10px;
        padding: 10px;
        font-size: 11px;
    }
}

/* Tablet */
@media (max-width: 1023px) and (min-width: 769px) {
    .variant-modal-content {
        max-width: 700px;
    }

    .variant-modal-body {
        gap: 30px;
    }

    .variant-modal-info {
        padding: 30px 30px 30px 0;
    }
}
