/* ============================
   STARBUCKS CUSTOMIZATION MODAL
   Estilos idénticos a la app de Starbucks
   ============================ */

/* Modal Overlay */
.starbucks-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.starbucks-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.starbucks-modal {
    background: white;
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.starbucks-modal-overlay.show .starbucks-modal {
    transform: translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close-btn {
    position: absolute;
    left: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background: #f0f0f0;
}

/* Product Summary */
.product-summary {
    display: flex;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.product-summary .product-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-summary .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-summary .product-image i {
    font-size: 32px;
    color: #ccc;
}

.product-summary .product-info {
    flex: 1;
}

.product-summary .product-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.product-summary .product-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.price-display {
    display: flex;
    align-items: center;
}

.total-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Customization Sections */
.customization-sections {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 120px 0; /* Espacio adicional para menú inferior */
}

.customization-section {
    border-bottom: 1px solid #f0f0f0;
    padding: 20px;
}

.customization-section:last-child {
    border-bottom: none;
}

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

/* Size Options (Grid Layout) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.option-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-card.selected {
    border-color: var(--primary-color);
    background: rgba(0, 112, 74, 0.05);
}

.option-card:active {
    transform: scale(0.95);
}

.size-icon {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.cup-icon {
    width: 24px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 0 0 8px 8px;
    position: relative;
}

.cup-icon.tall {
    height: 28px;
}

.cup-icon.grande {
    height: 32px;
}

.cup-icon.venti {
    height: 36px;
}

.cup-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -2px;
    right: -2px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.option-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.option-detail {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

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

/* List Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.option-row:hover {
    background: #f8f8f8;
}

.option-row.selected {
    background: rgba(0, 112, 74, 0.05);
}

.option-row .option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.option-row .option-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

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

/* Check Icon */
.option-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.option-row.selected .option-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.option-check i {
    font-size: 12px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.option-row.selected .option-check i {
    opacity: 1;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-btn.minus {
    background: #e0e0e0;
    color: #666;
}

.qty-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 20px;
    text-align: center;
}

/* Toggle Switch */
.option-toggle {
    display: flex;
    align-items: center;
}

.toggle-switch {
    width: 48px;
    height: 28px;
    background: #e0e0e0;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch.active {
    background: var(--primary-color);
}

.toggle-slider {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

/* Modal Footer */
.modal-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.add-to-cart-btn:active {
    transform: scale(0.98);
    background: var(--primary-dark);
}

/* Desktop Styles */
@media (min-width: 768px) {
    .starbucks-modal-overlay {
        align-items: center;
        justify-content: center;
    }
    
    .starbucks-modal {
        width: 90%;
        max-width: 500px;
        max-height: 80vh;
        border-radius: 20px;
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    
    .starbucks-modal-overlay.show .starbucks-modal {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    
    .options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Scrollbar Styling */
.customization-sections::-webkit-scrollbar {
    width: 4px;
}

.customization-sections::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.customization-sections::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.customization-sections::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Animation for option changes */
.option-card, .option-row {
    position: relative;
    overflow: hidden;
}

.option-card::after, .option-row::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 112, 74, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.option-card:active::after, .option-row:active::after {
    width: 200px;
    height: 200px;
}

/* Loading State */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f0f0f0;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    text-align: center;
}

/* Success State */
.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    text-align: center;
}