/**
 * TabPad Style Popup Enhancements - CSS
 * Variation selector, quantity stepper, order notes, favorites
 * Version: 1.0.0
 */

/* Enhanced Popup Container */
.resto-global-popup.tabpad-enhanced .popup-container {
    max-width: 520px;
    border-radius: 20px;
}

/* Popup Actions Bar */
.popup-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.popup-favorite-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #adb5bd;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.popup-favorite-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.popup-favorite-btn.active {
    color: #e74c3c;
    background: #fff5f5;
}

.popup-favorite-btn.active i {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.2);
    }
}

/* Variations Section */
.popup-variations {
    padding: 20px;
    border-bottom: 1px solid #f1f3f5;
}

.popup-variations-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-variations-title i {
    color: #e74c3c;
    font-size: 12px;
}

.popup-variations-title .required {
    color: #e74c3c;
    font-size: 11px;
    font-weight: 400;
}

.popup-variation-group {
    margin-bottom: 16px;
}

.popup-variation-group:last-child {
    margin-bottom: 0;
}

.popup-variation-group-title {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.popup-variation-option {
    flex: 1;
    min-width: 100px;
}

.popup-variation-option input[type="radio"] {
    display: none;
}

.popup-variation-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.popup-variation-option label:hover {
    border-color: #e74c3c;
    background: #fff5f5;
}

.popup-variation-option input[type="radio"]:checked+label {
    border-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.05), rgba(231, 76, 60, 0.1));
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.15);
}

.popup-variation-option input[type="radio"]:checked+label::before {
    content: '\f00c';
    font-family: FontAwesome;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.popup-variation-option label {
    position: relative;
}

.popup-variation-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
}

.popup-variation-price {
    font-size: 13px;
    font-weight: 600;
    color: #e74c3c;
}

.popup-variation-price.extra {
    color: #28a745;
}

/* Quantity Stepper */
.popup-quantity {
    padding: 20px;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popup-quantity-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.popup-quantity-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.popup-quantity-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #495057;
    transition: all 0.2s ease;
}

.popup-quantity-btn:hover {
    background: #e9ecef;
    color: #e74c3c;
}

.popup-quantity-btn:active {
    transform: scale(0.95);
}

.popup-quantity-btn:disabled {
    color: #adb5bd;
    cursor: not-allowed;
}

.popup-quantity-value {
    width: 50px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    background: #fff;
    padding: 10px 0;
}

/* Order Notes */
.popup-notes {
    padding: 20px;
    border-bottom: 1px solid #f1f3f5;
}

.popup-notes-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-notes-label i {
    color: #6c757d;
}

.popup-notes-textarea {
    width: 100%;
    min-height: 80px;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

.popup-notes-textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.popup-notes-textarea::placeholder {
    color: #adb5bd;
}

.popup-notes-counter {
    text-align: right;
    font-size: 12px;
    color: #adb5bd;
    margin-top: 6px;
}

.popup-notes-counter.warning {
    color: #ffc107;
}

.popup-notes-counter.error {
    color: #dc3545;
}

/* Allergen Badges */
.popup-allergens {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.popup-allergens-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-allergens-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.popup-allergen-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    font-size: 12px;
    color: #495057;
}

.popup-allergen-badge i {
    font-size: 14px;
}

.popup-allergen-badge.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Item Info Row */
.popup-info-row {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.popup-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6c757d;
}

.popup-info-item i {
    font-size: 16px;
    color: #e74c3c;
}

.popup-info-item strong {
    color: #495057;
}

/* Total Price Section */
.popup-total {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.popup-total-label {
    font-size: 14px;
    color: #6c757d;
}

.popup-total-price {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
}

/* Add to Cart Button */
.popup-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.popup-add-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.popup-add-btn:active {
    transform: translateY(0);
}

.popup-add-btn i {
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .resto-global-popup.tabpad-enhanced .popup-container {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
    }

    .popup-variation-options {
        flex-direction: column;
    }

    .popup-variation-option {
        min-width: auto;
    }

    .popup-quantity-stepper {
        transform: scale(0.9);
    }

    .popup-add-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Highlight animation for search results */
.resto-menu-item.search-highlight {
    animation: searchHighlight 2s ease;
}

@keyframes searchHighlight {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(231, 76, 60, 0.3);
    }
}