/**
 * Pack Selector CSS - Server-Rendered Version
 * Updated: 2026-04-13 - Fixed z-index issue (relative positioning)
 */

/* Container */
.pack-selector-container {
    margin: 12px 0;
    position: relative;
}

/* Trigger Button */
.pack-selector-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.pack-selector-trigger:hover {
    background: #f0f8fb;
    border-color: #0A5A7D;
}

.pack-selector-container.open .pack-selector-trigger {
    background: #e8f4f8;
    border-radius: 6px 6px 0 0;
}

/* Trigger Display - 3 Column Layout */
.pack-display {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.pack-quantity {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    justify-self: start;
}

.pack-price {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    justify-self: center;
}

.pack-unit-price {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    justify-self: end;
}

.pack-toggle {
    font-style: normal;
    transition: transform 0.3s ease;
    font-size: 10px;
    color: #666;
}

.pack-selector-container.open .pack-toggle {
    transform: rotate(180deg);
}

/* Dropdown - RELATIVE positioning (pushes content down) */
.pack-options-dropdown {
    display: none;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pack-selector-container.open .pack-options-dropdown {
    display: block;
}

/* Pack Option (Radio Button Label) */
.pack-option {
    display: block;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.pack-option:last-child {
    border-bottom: none;
}

.pack-option input[type="radio"] {
    display: none;
}

.pack-option .option-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    align-items: baseline;
    padding: 12px;
    gap: 8px;
    transition: background 0.2s ease;
}

.pack-option:hover .option-content {
    background: #f8f8f8;
}

.pack-option.selected .option-content {
    background: #e8f4f8;
}

.option-quantity {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    justify-self: start;
}

.option-price {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    justify-self: center;
}

.option-unit {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    justify-self: end;
}

.option-check {
    color: #0A5A7D;
    font-weight: bold;
    opacity: 0;
    margin-left: auto;
    font-size: 16px;
}

.pack-option.selected .option-check {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pack-selector-trigger {
        padding: 10px;
    }
    
    .pack-quantity,
    .option-quantity {
        font-size: 12px;
    }
    
    .pack-price,
    .option-price {
        font-size: 14px;
    }
    
    .pack-unit-price,
    .option-unit {
        font-size: 10px;
    }
}
