/* ===================================
   Product Custom Options Styles
   Similar to Ymq Product Options & Variants
   ================================ */

.custom-product-options {
    background: var(--background, #f9f8f6);
    border: 2px solid var(--primary, #d4a574);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.custom-product-options .options-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--text-dark, #2c2c2c);
    margin: 0 0 1.25rem 0;
    font-weight: 600;
}

/* Common Option Styles */
.custom-option {
    margin-bottom: 1.5rem;
}

.custom-option:last-child {
    margin-bottom: 0;
}

.option-label {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-dark, #2c2c2c);
    margin-bottom: 0.75rem;
}

.option-label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

/* Color Option Styles */
.color-options-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.custom-color-button {
    width: 45px;
    height: 45px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.custom-color-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.custom-color-button.selected {
    border-color: var(--primary, #d4a574);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.custom-color-button .check-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-color-button.selected .check-icon {
    opacity: 1;
}

.selected-color-name {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light, #666);
    font-style: italic;
}

/* Image Select Option Styles (Ymq Type 8) */
.image-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.custom-image-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 3px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-image-button:hover {
    border-color: var(--primary, #d4a574);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.custom-image-button.selected {
    border-color: var(--primary, #d4a574);
    background: #fef8f1;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.25);
}

.custom-image-button .option-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.custom-image-button .image-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark, #2c2c2c);
    text-align: center;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.custom-image-button .image-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary, #d4a574);
}

.custom-image-button .check-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--primary, #d4a574);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-image-button.selected .check-overlay {
    opacity: 1;
    transform: scale(1);
}

.custom-image-button .check-overlay i {
    font-size: 0.9rem;
}

/* Image Select without image (e.g. Emballage options) */
.custom-image-button.no-image {
    padding: 1rem 0.75rem;
    justify-content: center;
    min-height: 70px;
}

.custom-image-button.no-image .image-label {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.custom-image-button.no-image .image-price {
    font-size: 0.9rem;
}

/* Select Option Styles */
.custom-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-select:hover {
    border-color: var(--primary, #d4a574);
}

.custom-select:focus {
    outline: none;
    border-color: var(--primary, #d4a574);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

/* Checkbox Option Styles */
.checkbox-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
}

.custom-checkbox-label:hover {
    border-color: var(--primary, #d4a574);
    background: #fafafa;
}

.custom-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-custom i {
    color: #fff;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-checkbox:checked + .checkbox-custom {
    background: var(--primary, #d4a574);
    border-color: var(--primary, #d4a574);
}

.custom-checkbox:checked + .checkbox-custom i {
    opacity: 1;
}

.checkbox-text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-dark, #2c2c2c);
}

.option-price {
    color: var(--primary, #d4a574);
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Text Input Option Styles */
.custom-text-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.custom-text-input:hover {
    border-color: var(--primary, #d4a574);
}

.custom-text-input:focus {
    outline: none;
    border-color: var(--primary, #d4a574);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light, #999);
    margin-top: 0.25rem;
}

/* Price Breakdown */
.options-price-breakdown {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e5e5;
    font-size: 0.9rem;
}

.price-breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    color: var(--text-light, #666);
}

/* Cart Options Display */
.cart-item-options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.cart-option {
    font-size: 0.8rem;
    color: var(--text-light, #666);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cart-option i {
    color: var(--primary, #d4a574);
    font-size: 0.7rem;
}

/* Accessory Quantity Badge */
.accessory-qty-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: #fff;
    border: 2px solid var(--primary, #d4a574);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 0.4rem;
    max-height: 0;
    opacity: 0;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.custom-image-button.selected .accessory-qty-badge {
    opacity: 1;
    max-height: 36px;
}

.accessory-qty-badge .qty-minus,
.accessory-qty-badge .qty-plus {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #d4a574);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    line-height: 1;
}

.accessory-qty-badge .qty-minus:hover,
.accessory-qty-badge .qty-plus:hover {
    background: #c4915a;
}

.accessory-qty-badge .qty-minus:active,
.accessory-qty-badge .qty-plus:active {
    background: #b07d48;
}

.accessory-qty-badge .qty-value {
    min-width: 24px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark, #2c2c2c);
    padding: 0 2px;
    line-height: 28px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .custom-product-options {
        padding: 1rem;
    }

    .options-title {
        font-size: 1.1rem;
    }

    .custom-color-button {
        width: 40px;
        height: 40px;
    }

    .checkbox-options-grid {
        gap: 0.5rem;
    }

    .custom-checkbox-label {
        padding: 0.6rem;
    }

    .accessory-qty-badge .qty-minus,
    .accessory-qty-badge .qty-plus {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }

    .accessory-qty-badge .qty-value {
        font-size: 0.85rem;
        line-height: 26px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-product-options {
    animation: fadeIn 0.3s ease-out;
}
