/* FLAGS Products - Checkout Modal Styles */

/* ============================================
   BUY BUTTON
   ============================================ */
.flags-buy-button-wrapper {
    margin: 15px 0;
    width: 100%;
}

.flags-buy-button {
    width: 100%;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #0b9949 !important;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flags-buy-button:hover {
    background-color: #098739 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(11, 153, 73, 0.3);
}

.flags-buy-button:active {
    transform: translateY(0);
}

.flags-buy-button.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.flags-buy-button.loading .flags-buy-button-text {
    opacity: 0.5;
}

.flags-buy-button.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Shortcode button variation */
.flags-shortcode-button .flags-buy-button {
    max-width: 300px;
    margin: 0 auto;
}

/* ============================================
   MODAL OVERLAY & CONTAINER
   ============================================ */
.flags-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.flags-modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.flags-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    z-index: 1;
    animation: fadeIn 0.3s ease;
}

.flags-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    z-index: 2;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* ============================================
   MODAL HEADER
   ============================================ */
.flags-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
    flex-shrink: 0;
}

.flags-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.flags-modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.flags-modal-close:hover {
    background: #e5e5e5;
    color: #333;
}

/* ============================================
   MODAL BODY
   ============================================ */
.flags-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex-grow: 1;
}

.flags-modal-loading {
    text-align: center;
    padding: 40px 20px;
}

.flags-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0b9949;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

.flags-modal-loading p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* ============================================
   CHECKOUT SUMMARY
   ============================================ */
.flags-checkout-summary {
    animation: fadeIn 0.3s ease;
}

.flags-product-details {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 20px;
}

.flags-product-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
}

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

.flags-product-info {
    flex-grow: 1;
}

.flags-product-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.flags-product-customization {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.flags-custom-item {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.flags-custom-item:last-child {
    margin-bottom: 0;
}

.flags-custom-item strong {
    color: #333;
    margin-right: 5px;
}

.flags-custom-item span {
    color: #0b9949;
    font-weight: 600;
}

.flags-product-quantity,
.flags-product-price {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.flags-product-quantity strong,
.flags-product-price strong {
    color: #333;
    margin-right: 5px;
}

.flags-product-price span {
    color: #0b9949;
    font-weight: 600;
    font-size: 16px;
}

/* ============================================
   TOTALS
   ============================================ */
.flags-checkout-totals {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.flags-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: #666;
    margin-bottom: 10px;
}

.flags-total-row:last-child {
    margin-bottom: 0;
}

.flags-total-row.flags-total {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding-top: 15px;
    border-top: 2px solid #e5e5e5;
    margin-top: 5px;
}

.flags-total-amount {
    color: #0b9949 !important;
    font-size: 22px !important;
}

/* ============================================
   CHECKOUT ACTIONS
   ============================================ */
.flags-checkout-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.flags-goto-checkout {
    width: 100%;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #0b9949 !important;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: block;
}

.flags-goto-checkout:hover {
    background-color: #098739 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(11, 153, 73, 0.3);
    color: #fff !important;
}

.flags-continue-shopping {
    width: 100%;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border: 2px solid #e5e5e5;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #666;
}

.flags-continue-shopping:hover {
    border-color: #0b9949;
    color: #0b9949;
    background-color: #f9f9f9;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .flags-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .flags-modal-header {
        padding: 15px 20px;
    }
    
    .flags-modal-header h2 {
        font-size: 18px;
    }
    
    .flags-modal-body {
        padding: 20px;
    }
    
    .flags-product-details {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .flags-product-image {
        width: 120px;
        height: 120px;
    }
    
    .flags-product-info {
        width: 100%;
    }
    
    .flags-buy-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .flags-goto-checkout {
        padding: 12px 20px;
        font-size: 14px;
    }
}
