/* Custom Product Modifier Widget Styles */

.custom-product-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    padding: 0;
}

/* Modifier Item Container */
.drawer-body-container {
    background: #ffffff;
    border: none;
    border-radius: 0;
    position: relative;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

/* Modifier Header */
.modifier-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
}

/* Modifier Subtitle - "Select an option" text */
.modifier-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #4f555e;
    margin-top: 4px;
    margin-bottom: 8px;
}

.modifier-title {
    font-size: 16px;
    margin: 0;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Required badge style */
.required-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 400;
    color: #C24B2C; /* warm orange text */
    background-color: #FDEAE4; /* soft peach background */
    border-radius: 1px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Required Text */
.drawer-required-text {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    background-color: #F2F4F7;
    color: #676D77;
}

/* Selected Value */
.modifier-selected-value {
    font-size: 16px;
    font-weight: 400;
    color: #000000;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    margin-left: 0;
    border: none;
    box-shadow: none;
    transition: all 0.3s ease;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Select Options Button */
.modifier-select-button {
    background-color: #f5f5f5;
    color: #666666;
    padding: 6px 12px;
    border-radius: 0; /* No border radius as per design */
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.modifier-select-button:hover {
    background-color: #eeeeee;
    border-color: #d0d0d0;
}

.modifier-selected-value.placeholder {
    color: #676D77;
    font-weight: 400;
    font-style: italic;
    font-size: 16px;
    transition: all 0.3s ease;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.modifier-selected-value:not(.placeholder) {
    color: #000000;
    font-weight: 700;
    font-size: 16px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    transition: all 0.3s ease;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.modifier-selected-value.selected {
    color: #000000;
    font-weight: normal;
    font-size: 16px;
    transition: all 0.3s ease;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Modifier Options */
.modifier-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.modifier-option {
    position: relative;
    appearance: none;
    font-family: Moderat, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: #ffffff;
    transition: all 0.2s ease;
    min-height: 32px;
    height: auto;
    color: rgba(0, 0, 0, 0.87);
    vertical-align: middle;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    width: fit-content;
    max-width: 100%;
    cursor: pointer;
    box-shadow: none;
    margin: 0px;
    white-space: normal;
    word-wrap: break-word;
    transition: background-color 300ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1);
    outline: 0px;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 0px;
    line-height: 1.4;
    box-shadow: rgba(0, 0, 0, 0.08) 0px 1px 12px 0px;
}

.modifier-option:hover {
    background-color: rgba(0, 0, 0, 0.12) !important;
}

.modifier-option.selected {
    background-color: #ffffff !important;
    box-shadow: rgba(0, 0, 0, 0.12) 0px 2px 16px 0px;
    position: relative;
    border: 2px solid #000000 !important;
}

.modifier-option.selected:hover {
    background-color: rgba(0, 0, 0, 0.16) !important;
}

.modifier-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.modifier-option label {
    cursor: pointer;
    font-size: 16px !important;
    color: #000000;
    text-align: center;
    margin: 0;
    font-weight: inherit !important;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
    display: inline-block;
    max-width: 100%;
}

/* Chip Style */
.modifier-type-chip .modifier-option {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 36px;
    height: auto;
    width: fit-content;
    max-width: 100%;
    background-color: #ffffff;
    border: none;
    white-space: normal;
    word-wrap: break-word;
    padding: 6px 16px;
    flex-wrap: wrap;
}

.modifier-type-chip .modifier-option:hover {
    background-color: #f0f0f0;
}

.modifier-type-chip .modifier-option.selected {
    border: 2px solid #000000 !important;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modifier-type-chip .modifier-option.selected:hover {
    background-color: rgba(0, 0, 0, 0.16) !important;
}

.modifier-type-chip input[type="radio"]:checked + label {
    color: #333;
    font-weight: inherit !important;
}

/* Swatch Style */
.modifier-type-swatch .modifier-option {
    /* border-radius: 4px; */
    /* padding: 6px 20px; */
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    width: max-content;
    background-color: #ffffff;
    border: none;
    white-space: nowrap;
}

.modifier-type-swatch .modifier-option:hover {
    background-color: #f0f0f0;
}

.modifier-type-swatch .modifier-option.selected {
    border: 1px solid #000000 !important;
    /* background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.modifier-type-swatch .modifier-option.selected:hover {
    background-color: rgba(0, 0, 0, 0.16) !important;
}

.swatch-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0px;
    margin-bottom: 12px;
    border: 1px solid #dee2e6;
}

.swatch-name {
    font-size: 13px;
    color: #333;
    text-align: center;
    margin-bottom: 6px;
    font-weight: 500;
}

.swatch-price {
    font-size: 12px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

/* Counter Controls */
.counter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #f9f9f9;
}

.counter-decrease,
.counter-increase {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.counter-decrease:hover,
.counter-increase:hover {
    background-color: #1976d2;
    color: white;
    /* border-color: #1976d2; */
}

.counter-value {
    font-size: 16px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    color: #333;
}

.counter-label {
    font-size: 14px;
    color: #666;
    flex: 1;
}

.counter-price {
    font-size: 12px;
    color: #1976d2;
    font-weight: 500;
}

/* Text Input Container */
.text-input-container {
    margin: 15px 0;
}

.text-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.text-input:focus {
    outline: none;
    /* border-color: #1976d2; */
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.text-counter {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Option Name and Price */
.option-name {
    display: inline;
    word-wrap: break-word;
}

.option-sep {
    display: inline;
    margin: 0 2px;
}

/* Option Price */
.option-price {
    font-size: 12px;
    color: #000000;
    font-weight: 500;
    display: inline;
    white-space: nowrap;
}

/* No Options */
.no-options {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
    background-color: #f9f9f9;
    border-radius: 6px;
}

/* Modifier Disclaimer */
.modifier-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 15px;
    padding: 12px;
    background-color: #F0F6FF;
    border-radius: 6px;
    border-left: 4px solid #1976d2;
}

.disclaimer-icon {
    font-size: 16px;
    color: #1976d2;
    opacity: 0.8;
    flex-shrink: 0;
    margin-top: 2px;
}

.disclaimer-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    white-space: pre-line;
}

/* Divider */
.modifier-divider {
    height: 1px;
    background: #e5e7eb; /* subtle gray */
    width: 100%;
    border: none;
    margin: 28px 0px;
    opacity: 1;
    position: relative;
    z-index: 1;
}

/* Ensure divider is always visible even in scrollable containers */
.drawer-body .modifier-divider,
.custom-product-drawer-body .modifier-divider {
    background: #e5e7eb;
    
}


.drawer-body{
    display: flex;
    /* gap: 20px; */
    /* padding: 20px; */
    background: #FFF !important;
    opacity: 1 !important;
    flex: 1;          /* fill between header and footer */
    min-height: 0;    /* allow children to overflow/scroll correctly */
    overflow: hidden; /* confine scroll to columns */
}

/* Left and Right Section Overflow */
.drawer-body-left, .drawer-body-right {
    flex: 1;
    min-width: 0;
    height: 100%;     /* take full height of body area */
    overflow-y: auto; /* scroll inside columns */
    padding: 20px;
    /* Hide scrollbar for webkit browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.drawer-body-left::-webkit-scrollbar,
.drawer-body-right::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-product-drawer-body {
        gap: 15px;
    }
    
    .drawer-body-container {
        padding: 15px;
    }
    
    .modifier-header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .modifier-title {
        font-size: 16px;
    }
    
    .modifier-options {
        gap: 10px;
    }
    
    .modifier-option {
        min-height: 30px;
        height: auto;
        padding: 6px 14px;
        max-width: 100%;
    }
    
    .modifier-option label {
        font-size: 14px !important;
    }
    
    .counter-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .modifier-type-chip .modifier-option {
        margin: 2px;
        min-height: 32px;
        height: auto;
    }
    
    .modifier-selected-value {
        font-size: 14px;
    }
    
    .drawer-body-left, .drawer-body-right {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .drawer-body-container {
        padding: 12px;
    }
    
    .modifier-title {
        font-size: 14px;
    }
    
    .modifier-options {
        gap: 8px;
    }
    
    .modifier-option {
        min-height: 28px;
        height: auto;
        padding: 5px 12px;
        max-width: 100%;
    }
    
    .modifier-option label {
        font-size: 13px !important;
    }
    
    .modifier-type-chip .modifier-option {
        min-height: 30px;
        height: auto;
    }
    
    .modifier-selected-value {
        font-size: 13px;
    }
    
    .modifier-selected-value.placeholder {
        font-size: 13px;
    }
    
    .search-input {
        padding: 8px 10px;
    }
    
    .text-input {
        min-height: 60px;
        padding: 10px;
    }
    
    .drawer-body-left, .drawer-body-right {
        padding: 12px;
    }
    
    .required-badge {
        font-size: 12px;
        padding: 3px 6px;
    }
}

/* Focus States for Accessibility */
.modifier-option:focus-within {
    /* outline: 2px solid #1976d2; */
    outline-offset: 2px;
}

.counter-decrease:focus,
.counter-increase:focus {
    /* outline: 2px solid #1976d2; */
    outline-offset: 2px;
}

.search-input:focus {
    /* outline: 2px solid #1976d2; */
    outline-offset: 2px;
}

.text-input:focus {
    /* outline: 2px solid #1976d2; */
    outline-offset: 2px;
}

/* Animation for smooth transitions */

.counter-decrease,
.counter-increase {
    transition: all 0.2s ease;
}

.search-input,
.text-input {
    transition: all 0.3s ease;
}

/* Custom scrollbar for textarea */
.text-input::-webkit-scrollbar {
    width: 6px;
}

.text-input::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.text-input::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.text-input::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Hover Tooltip */
.option-hover-tooltip {
    position: fixed;
    background-color: #333333;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 0px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.2s ease;
    white-space: nowrap;
    border: none;
    min-width: 60px;
    text-align: center;
}

.option-hover-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #333333;
}

