/* Product Modal Styles */

/* Ensure modal content is interactive */
.product-modal__content {
    pointer-events: auto;
}

/* Ensure variation container is interactive */
.product-modal .sq-variation-item,
.product-modal .sq-variations {
    pointer-events: auto;
    position: relative;
}

/* Ensure request list button and form are interactive in modal */
.product-modal .sq-cart-form,
.product-modal .sq-request-button-wrapper,
.product-modal .sq-add-to-request-button {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

/* Modal Container - Product specific sizing */
.product-modal__container {
    padding: 0;
    max-width: 1260px;
    width: 90%;
}

/* Modal Header - Visible for close button */
.product-modal__header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 0;
    margin: 0;
}

/* Hide the h2 title visually but keep it for accessibility */
#product-modal-title {
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}

/* Modal Close Button - Square with rounded corner */
.product-modal__close {
    width: 50px;
    height: 50px;
    background-color: #425EAB;
    border: none;
    border-radius: 0 8px 0 0;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.product-modal__close:hover {
    opacity: 0.9;
}

.product-modal__close svg {
    width: 24px;
    height: 24px;
    color: #FFF4E4;
    stroke: #FFF4E4;
}

/* Modal Content */
.product-modal__content {
    /* display: grid;
    gap: 0;
    grid-template-columns: 1fr; */
    /* padding: 103px 116px 103px 116px; */
    display: grid;
    padding: 1rem 4rem 3rem 4rem;
    .modal-image-wrapper{
        display: grid;
        gap: 1rem;
        margin-block-end: 1rem;
        position: relative;
        .modal-gallery-swiper{
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            .swiper-slide{
                display: flex;
                align-items: center;
                justify-content: center;
                img{
                    max-height: 58vh !important;
                    height: auto;
                    max-width: 100%;
                }
            }
        }
    }
}

@media (min-width: 1024px){
    .product-modal__content{
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

/* @media (min-width: 768px) {
    .product-modal__content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }
}


@media (min-width: 1200px) {
    .product-modal__content {
        grid-template-columns: 390px 1fr;
        gap: 36px;
    }
} */


/* .modal-image-wrapper {
    position: relative;
    width: 100%;
}

.modal-product-image {
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.modal-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    display: block;
} */

/* Modal Gallery Swiper */

.modal-gallery-swiper {
    /* border-radius: 12px;
    overflow: hidden;
    width: 100%;
    height: auto;
    min-height: 400px; */
}

.modal-gallery-swiper .swiper-slide {
    /* display: flex;
    align-items: center;
    justify-content: center;
    height: auto; */
}

.modal-gallery-swiper .swiper-slide img {
    /* width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 12px; */
}

/* Modal Gallery Pagination */
.modal-gallery-pagination {
    position: relative !important;
    bottom: 0 !important;
    margin-top: 16px;
    text-align: center;
}

.modal-gallery-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #D1D5DB;
    opacity: 1;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.modal-gallery-pagination .swiper-pagination-bullet-active {
    background: #343434;
    width: 24px;
    border-radius: 4px;
}

.modal-gallery-pagination .swiper-pagination-bullet:hover {
    background: #9CA3AF;
    cursor: pointer;
}


.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.modal-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.modal-product-title {
    font-family: var(--wp--preset--font-family--kollektif, 'Kollektif', sans-serif);
    font-size: var(--wp--preset--font-size--extra-large, 40px);
    font-weight: 400;
    line-height: 1.1;
    margin: 0;
    color: #000000;
    flex: 1;
}

.modal-product-category {
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--medium, 24px);
    color: #828282;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.5;
}

.modal-product-price {
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--large, 32px);
    font-weight: 500;
    color: #000000;
    margin: 0;
    line-height: 1.5;
}

.modal-stock-status {
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--small, 16px);
    font-weight: 500;
    color: #828282;
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

.modal-stock-status.in-stock {
    color: #828282;
    background: none;
}

.modal-stock-status.out-of-stock {
    color: #ef4444;
    background: none;
}

.modal-variations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}

.modal-variation-select select {
    width: 100%;
}

/* Style for disabled options in modal variation dropdowns */
.modal-variation-select select option:disabled,
.product-modal .sq-variation-select option:disabled {
    color: #999;
    background-color: #f5f5f5;
    cursor: not-allowed;
}
/* Reset variations button in modal */
.product-modal .sq-reset-variations-button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #666;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.product-modal .sq-reset-variations-button:hover {
    color: #333;
    border-color: #999;
    background-color: #f5f5f5;
}

/* Ensure stock status is on its own line in modal */
.product-modal .sq-stock-status {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}
    padding: 12px 16px;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--small, 16px);
    color: rgb(100, 100, 100);
    background-color: #fff;
    margin-bottom: 1rem;
}

.modal-variation-select select:focus {
    outline: none;
    border-color: #343434;
}

.modal-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.modal-quantity {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
}

.modal-add-to-cart {
    background-color: #343434;
    color: #ffffff;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--small, 16px);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    line-height: 1.5;
    box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
}

.modal-add-to-cart:hover {
    background-color: #222;
}

.modal-add-to-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.modal-wishlist-btn {
    width: 43px;
    height: 43px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.modal-wishlist-btn svg {
    width: 37.45px;
    transition: fill 0.3s ease;
}

/* Pulsing animation for loading state */
.modal-wishlist-btn.pulsing svg {
    animation: wishlist-pulse 0.8s ease-in-out infinite;
}

/* Ripple effect for fill/unfill */
.modal-wishlist-btn.ripple svg {
    animation: wishlist-ripple 0.5s ease-out;
}
.modal-wishlist-btn.ripple svg {
    animation: wishlist-ripple 0.5s ease-out;
    height: 32.67px;
    stroke: #343434;
    stroke-width: 4px;
    fill: none;
}

.modal-read-more {
    color: #828282;
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    margin: 0;
    display: inline-block;
    align-self: flex-end;
    margin-block-start: auto;
}

.modal-read-more:hover {
    text-decoration: underline;
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
    .product-modal__container {
        max-height: 95vh;
        overflow-y: auto;
    }

    .product-modal__content {
        grid-template-columns: 1fr;
        padding: 1rem 2.5rem 2.5rem 2.5rem;
    }
    
    .modal-image-wrapper {
        margin-bottom: 2rem;
    }
    
    .modal-product-title {
        font-size: var(--wp--preset--font-size--large, 32px);
    }
    
    .modal-product-category {
        font-size: 18px;
    }
    
    .modal-product-price {
        font-size: var(--wp--preset--font-size--medium, 24px);
    }

    .product-modal__close {
        width: 48px;
        height: 48px;
    }

    .product-modal__close svg {
        width: 20px;
        height: 20px;
    }
}

.modal-success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 0.75rem;
    border-radius: 0.25rem;
    text-align: center;
}

/* Modal Loading State */
.modal-form-loading,
.modal-gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 2rem;
    min-height: 200px;
}

.modal-gallery-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    border-radius: 12px;
}

.modal-gallery-loading.hidden {
    display: none;
}

.modal-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #343434;
    border-radius: 50%;
    animation: modal-spin 1s linear infinite;
}

.modal-form-loading span,
.modal-gallery-loading span {
    font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
    font-size: var(--wp--preset--font-size--small, 16px);
    color: #828282;
}

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