/* ============================================
   NORMAL BEAUTIFUL POPUP STYLES
   ============================================ */

/* Modal Dialog Sizing & Positioning */
.modal-dialog.modal-xl {
    max-width: 90vw !important;
    width: 90vw !important;
    margin: 20px auto;
}

/* Content Container */
.modern-product-modal {
    border: none;
    border-radius: 20px;
    background: white;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    overflow: hidden;
    /* Prevent scrolling in modal */
}

.modern-product-modal .modal-body {
    padding: 0;
    flex: 1;
    display: flex;
    overflow: hidden;
    /* Ensure rounded corners for internal row */
    border-radius: 20px;
}

.modern-product-modal .modal-body .row {
    width: 100%;
    margin: 0;
}

.modern-product-modal .modal-body .row>div {
    display: flex;
    flex-direction: column;
}

/* Close Button - Clean & Proper Positioning */
.btn-close-modern {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    /* Ensure on top */
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-close-modern:hover {
    background: #FE724C;
    border-color: #FE724C;
    color: white;
    transform: rotate(90deg);
}

/* Image Section - Full Height Cover */
.product-modal-image {
    position: relative;
    height: 100%;
    min-height: 400px;
    /* Minimum height for visual balance */
    background: #f8f9fa;
    flex: 1;
    /* Force image container to fill the flex column */
    display: flex;
    /* Clip image to container bounds handled by specific media queries or border-radius on img */
    /* overflow: hidden; removed to allow precise border-radius control on image */
}

.product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 0 !important;
    /* Let container handle rounding */
}

/* Wishlist Badge on Image */
.wishlist-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.wishlist-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.wishlist-btn:hover {
    color: #FE724C;
    transform: scale(1.1);
}

/* Price Badge on Image */
.image-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
}

.price-badge {
    background: white;
    padding: 8px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 5px;
}

.price-badge .currency {
    color: #FE724C;
    font-weight: 700;
    font-size: 18px;
}

.price-badge .amount {
    color: #333;
    font-weight: 800;
    font-size: 24px;
}

/* Content Details Section */
.product-modal-details {
    padding: 25px 35px;
    background: #fff;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* No scrolling */
}

/* Product Header */
.product-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
}

.product-title {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0;
    line-height: 1.2;
}

.product-category {
    display: none;
    /* Hide category to save space and reduce clutter */
}

.product-specs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0;
}

.product-divider {
    display: none;
    /* Remove divider as header border handles it */
}

.spec-badge {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 5px;
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 5px;
}

/* Divider removed in favor of header border */

/* Form Sections */
.selection-section {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 20px;
}

.selection-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-label {
    padding: 10px 25px;
    /* Increased padding */
    border: 2px solid #eee;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
    /* Increased width */
    text-align: center;
}

.size-option input[type="radio"] {
    display: none;
}

.size-option input:checked+.size-label {
    border-color: #FE724C;
    background: #FFF5F1;
    color: #FE724C;
}

.size-name {
    font-weight: 700;
    font-size: 14px;
}

.size-price {
    font-size: 12px;
    margin-top: 2px;
}

/* Addons */
.addon-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.addon-option {
    padding: 10px 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
}

.addon-option:hover {
    background: #f9f9f9;
}

.addon-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #FE724C;
    margin-right: 10px;
}

.addon-label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
}

/* Add to Cart Button - Normal & Big */
.action-buttons {
    margin-top: 20px;
    /* Reduced margin */
}

.add-to-cart-modal-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FE724C 0%, #FF8A5B 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(254, 114, 76, 0.3);
}

.add-to-cart-modal-btn:hover {
    background: linear-gradient(135deg, #FF8A5B 0%, #FE724C 100%);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(254, 114, 76, 0.4);
}

/* Desktop Width Adjustment - Image 60% / Details 40% */
@media (min-width: 992px) {
    .modern-product-modal .modal-body .col-lg-6:first-child {
        flex: 0 0 60% !important;
        max-width: 60% !important;
    }

    .modern-product-modal .modal-body .col-lg-6:last-child {
        flex: 0 0 40% !important;
        max-width: 40% !important;
    }

    /* Desktop Modal Sizing */
    .modal-dialog.modal-xl {
        max-width: 900px !important; /* Compact width like Home */
        margin: 30px auto;
    }

    .modern-product-modal {
        min-height: 450px;
    }

    /* Desktop Image Radius Fix */
    .product-modal-image {
        border-radius: 20px 0 0 20px;
        overflow: hidden;
        height: 500px !important; /* Reduced height to match Home reference */
    }

    .product-modal-image img {
        border-radius: 20px 0 0 20px !important;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Responsive Fixes */
@media (max-width: 991px) {
    .modal-dialog.modal-xl {
        max-width: 600px !important;
        margin: 1.75rem auto;
    }

    .modern-product-modal {
        flex-direction: column;
        max-height: 90vh;
        /* Limit height */
        overflow-y: auto;
        /* Scrollable if needed */
    }

    .modern-product-modal .modal-body .row {
        flex-direction: column !important;
    }

    .modern-product-modal .modal-body .col-lg-6,
    .modern-product-modal .modal-body .col-md-5,
    .modern-product-modal .modal-body .col-md-7 {
        width: 100% !important;
        flex: 0 0 auto !important;
        max-width: 100% !important;
    }

    /* Specific override requested by user */
    .modern-product-modal .modal-body .col-md-5 {
        flex: 0 0 auto !important;
        width: 100.666667% !important;
    }

    .product-modal-image {
        flex: none !important;
        width: 100% !important;
        min-height: 450px;
        /* Large image */
        border-radius: 20px 20px 0 0;
        /* Rounded top only */
    }

    /* Overlay Close Button on Tablet */
    .btn-close-modern {
        background: rgba(255, 255, 255, 0.9);
        top: 20px;
        right: 20px;
    }

    .product-modal-details {
        padding: 30px;
        border-radius: 0 0 20px 20px;
    }

    /* Stack Action Unit: Qty on Top, Button Below */
    .modal-action-unit {
        flex-direction: column !important;
        gap: 15px !important;
        padding: 15px !important;
        border-radius: 12px !important;
        /* Reduced Radius */
    }

    .modal-qty-group {
        width: 100% !important;
        justify-content: center !important;
        padding: 0 !important;
        border-bottom: 1px solid #eee;
        padding-bottom: 15px !important;
    }

    .modal-add-btn-premium {
        width: 100% !important;
        justify-content: center !important;
        border-radius: 12px !important;
        /* Reduced Button Radius */
        gap: 10px !important;
    }

    /* Clean up arrow icon on mobile */
    .modal-add-btn-premium .btn-arrow {
        background: transparent !important;
        width: auto !important;
        height: auto !important;
        font-size: 14px !important;
    }
}

@media (max-width: 767px) {
    .modal-dialog.modal-xl {
        width: 95%;
        margin: 10px auto;
        max-height: 95vh;
    }

    .modern-product-modal {
        flex-direction: column;
        max-height: 95vh;
        overflow: hidden;
    }

    .product-modal-image {
        min-height: 300px !important;
        max-height: 300px !important;
        flex: none !important;
    }

    .product-title {
        font-size: 22px;
    }

    .modal-dialog-centered {
        display: flex !important;
        align-items: center !important;
        min-height: calc(100% - 3.5rem) !important;
    }

    .product-modal-details {
        padding: 20px !important;
        overflow-y: auto !important;
        max-height: calc(95vh - 300px) !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure button area is always visible */
    .modal-action-unit {
        position: sticky !important;
        bottom: 0 !important;
        background: white !important;
        z-index: 10 !important;
        margin: 0 -20px -20px -20px !important;
        padding: 15px 20px !important;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1) !important;
    }
}

/* Specific Shopping Cart Modal Override to Cap Width */
.shopping-cart .modal .modal-dialog {
    max-width: 1000px !important;
}