/**
 * WooFood Modal Templates CSS
 * Complete WooFood design system for product modals
 * 
 * @package WooFood
 * @version 1.0.0
 */

/* ====================================
   MODAL ADD TO CART CONTAINER
   ==================================== */
.woofood-modal-add-to-cart {
    margin-top: 24px;
    padding: 0;
}

.woofood-cart-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ====================================
   CART ROW LAYOUT
   ==================================== */
.woofood-cart-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.woofood-cart-row .quantity {
    flex: 0 0 auto;
    margin: 0;
}

.woofood-cart-row .single_add_to_cart_button {
    flex: 1;
    min-width: 200px;
}

/* ====================================
   QUANTITY CONTROLS
   ==================================== */
.woofood-quantity-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.woofood-quantity-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--woofood-text-color, #374151);
    margin: 0;
}

.woofood-quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid var(--woofood-primary-color, #ff6b35);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    width: fit-content;
}

.woofood-quantity-btn {
    background: var(--woofood-primary-color, #ff6b35);
    color: white;
    border: none;
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
}

.woofood-quantity-btn:hover {
    background: var(--woofood-accent-color, #e74c3c);
    transform: scale(1.05);
}

.woofood-quantity-btn:active {
    transform: scale(0.95);
}

.woofood-quantity-input {
    border: none;
    padding: 12px 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--woofood-text-color, #374151);
    background: transparent;
    width: 80px;
    outline: none;
    -moz-appearance: textfield;
}

.woofood-quantity-input::-webkit-outer-spin-button,
.woofood-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.woofood-quantity-input:focus {
    outline: none;
    background: rgba(255, 107, 53, 0.05);
}

/* ====================================
   ADD TO CART BUTTON
   ==================================== */
.single_add_to_cart_button.woofood-add-to-cart-btn {
    background: var(--woofood-primary-color, #ff6b35) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 16px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.single_add_to_cart_button.woofood-add-to-cart-btn:hover {
    background: var(--woofood-accent-color, #e74c3c) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.single_add_to_cart_button.woofood-add-to-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

.single_add_to_cart_button.woofood-add-to-cart-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.woofood-btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.woofood-btn-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.woofood-add-to-cart-btn:hover .woofood-btn-icon {
    transform: scale(1.1);
}

.woofood-btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.woofood-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: woofood-spin 1s linear infinite;
}

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

.single_add_to_cart_button.woofood-add-to-cart-btn.loading .woofood-btn-content {
    display: none;
}

.single_add_to_cart_button.woofood-add-to-cart-btn.loading .woofood-btn-loading {
    display: flex;
}

/* External Product Button */
.single_add_to_cart_button.woofood-external-btn {
    background: var(--woofood-secondary-color, #cc8800) !important;
}

.single_add_to_cart_button.woofood-external-btn:hover {
    background: var(--woofood-accent-color, #e74c3c) !important;
}

/* ====================================
   VARIABLE PRODUCT STYLING
   ==================================== */
.woofood-modal-variations {
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.woofood-variations-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--woofood-text-color, #374151);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--woofood-primary-color, #ff6b35);
}

.woofood-variation-group {
    margin-bottom: 20px;
}

.woofood-variation-group:last-child {
    margin-bottom: 0;
}

.woofood-variation-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--woofood-text-color, #374151);
    margin-bottom: 8px;
}

.woofood-variation-select-wrapper {
    position: relative;
}

.woofood-variation-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: var(--woofood-text-color, #374151);
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.woofood-variation-select:focus {
    outline: none;
    border-color: var(--woofood-primary-color, #ff6b35);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.woofood-reset-variations {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--woofood-accent-color, #e74c3c);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.woofood-reset-variations:hover {
    background: #c0392b;
    transform: translateY(-50%) scale(1.05);
}

/* ====================================
   GROUPED PRODUCT STYLING
   ==================================== */
.woofood-grouped-product-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.woofood-grouped-product-table th,
.woofood-grouped-product-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.woofood-grouped-product-table th {
    font-weight: 600;
    color: var(--woofood-text-color, #374151);
    background: var(--woofood-primary-color, #ff6b35);
    color: white;
}

.woofood-grouped-product-table tr:last-child td {
    border-bottom: none;
}

.woofood-grouped-product-title {
    font-weight: 600;
    color: var(--woofood-text-color, #374151);
}

.woofood-grouped-product-price {
    color: var(--woofood-primary-color, #ff6b35);
    font-weight: 600;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */
@media (max-width: 768px) {
    .woofood-modal-add-to-cart {
        margin-top: 16px;
    }
    
    .woofood-cart-form {
        gap: 16px;
    }
    
    .woofood-quantity-controls {
        width: 100%;
        max-width: 200px;
    }
    
    .woofood-quantity-btn {
        padding: 10px 12px;
        min-width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    .woofood-quantity-input {
        width: 60px;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .woofood-add-to-cart-btn {
        padding: 14px 20px;
        font-size: 14px;
        min-height: 48px;
    }
    
    .woofood-modal-variations {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .woofood-variations-title {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .woofood-variation-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .woofood-grouped-product-table th,
    .woofood-grouped-product-table td {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Mobile cart row */
    .woofood-cart-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .woofood-cart-row .quantity {
        align-self: center;
    }
    
    .woofood-cart-row .single_add_to_cart_button {
        flex: none;
        min-width: auto;
        width: 100%;
    }
}

/* ====================================
   ACCESSIBILITY
   ==================================== */
.woofood-add-to-cart-btn:focus,
.woofood-quantity-btn:focus,
.woofood-variation-select:focus,
.woofood-quantity-input:focus {
    outline: 2px solid var(--woofood-primary-color, #ff6b35);
    outline-offset: 2px;
}

/* ====================================
   RTL SUPPORT
   ==================================== */
.woofood-plugin-rtl .woofood-cart-form {
    direction: rtl;
}

.woofood-plugin-rtl .woofood-variation-label,
.woofood-plugin-rtl .woofood-quantity-label {
    text-align: right;
}

.woofood-plugin-rtl .woofood-grouped-product-table th,
.woofood-plugin-rtl .woofood-grouped-product-table td {
    text-align: right;
}

.woofood-plugin-rtl .woofood-variation-select {
    background-position: left 12px center;
    padding-left: 40px;
    padding-right: 16px;
}

.woofood-plugin-rtl .woofood-reset-variations {
    right: auto;
    left: 8px;
}