/* ===== SIZE SELECTION POPUP STYLES ===== */

/* Popup Overlay */
.size-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.size-selection-overlay.show {
    opacity: 1;
}

/* Popup Container */
.size-selection-popup {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.size-selection-overlay.show .size-selection-popup {
    transform: scale(1) translateY(0);
}

/* Popup Header */
.size-popup-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.size-popup-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.size-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #767676;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.size-popup-close:hover {
    background: #f5f5f5;
    color: #666;
}

/* Product Info Section */
.size-popup-product {
    padding: 20px 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.size-popup-product-image {
    width: 80px;
    height: 80px;
    background: #f8f8f8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.size-popup-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.size-popup-product-details h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.size-popup-product-manufacturer {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.size-popup-base-price {
    font-size: 14px;
    color: #767676;
}

/* Size Selection Section */
.size-popup-content {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Multi-product support */
.product-section {
    margin-bottom: 20px;
}

.product-separator {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 24px 0;
}

.size-selection-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 12px 0;
}

.size-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.size-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.size-option:hover {
    border-color: #d0d0d0;
    background: #f9f9f9;
}

.size-option.selected {
    border-color: var(--primary-green) !important;
    background: var(--light-green) !important;
    box-shadow: 0 0 0 1px var(--primary-green);
}

.size-option-radio {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e5e5;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.size-option.selected .size-option-radio {
    border-color: var(--primary-green) !important;
    border-width: 3px !important;
}

.size-option.selected .size-option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--primary-green);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px white;
}

.size-option-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.size-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.size-option-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
}

.size-option-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.size-option-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.size-option-price-old {
    font-size: 13px;
    font-weight: 400;
    color: #767676;
    text-decoration: line-through;
}

.size-option-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-green);
}

.size-option-pzn {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.size-option-badge {
    font-size: 11px;
    font-weight: 600;
    color: #ea580c;
    background: #fff7ed;
    padding: 1px 6px;
    border-radius: 3px;
}

.size-option-unit-price {
    font-size: 11px;
    font-weight: 400;
    color: #666;
}

/* Quantity Selection */
.quantity-section {
    margin-bottom: 24px;
}

.quantity-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 12px 0;
}

/* Quantity Controls - standardized design */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    padding: 0;
}

.quantity-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 600;
}

.quantity-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

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

.quantity-btn:disabled:hover {
    background: #f8fafc;
    color: #64748b;
}

.quantity-display {
    min-width: 40px;
    height: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup Footer */
.size-popup-footer {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    padding: 12px 24px;
    background: white;
    color: #666;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.btn-add-to-cart-popup {
    flex: 2;
    padding: 12px 24px;
    background: var(--primary-green);
    color: white;
    border: 2px solid var(--primary-green);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-to-cart-popup:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    transform: translateY(-1px);
}

.btn-add-to-cart-popup:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-add-to-cart-popup:disabled:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    transform: none;
}

/* ===== SIZE OPTION STOCK STATES ===== */
.size-option--out {
    border-color: #f0f0f0 !important;
    background: #fafafa !important;
}

.size-option-stock {
    font-size: 11px;
    font-weight: 600;
    color: #991b1b;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.size-option-stock--low {
    color: #92400e;
    background: #fef3c7;
}

.size-option-stock--order {
    color: #92400e;
    background: #fffbeb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .size-selection-popup {
        width: 95%;
        margin: 20px;
    }

    .size-popup-header,
    .size-popup-product,
    .size-popup-content,
    .size-popup-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .size-popup-product {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .size-popup-product-image {
        width: 100px;
        height: 100px;
    }

    .size-popup-footer {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-add-to-cart-popup {
        flex: none;
    }
}

@media (max-width: 480px) {
    .size-selection-popup {
        width: 100%;
        margin: 10px;
        border-radius: 8px;
    }

    .size-option {
        padding: 10px 12px;
    }

    /* Keep horizontal layout on mobile: size on left, price on right */
    .size-option-details {
        gap: 8px;
    }

    .size-option-name {
        font-size: 14px;
    }

    .size-option-price-old {
        font-size: 12px;
    }

    .size-option-price {
        font-size: 14px;
    }

    .size-option-unit-price {
        font-size: 10px;
    }

    .quantity-controls {
        justify-content: center;
    }
}