#qpd-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

#qpd-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}
.qpd-hidden {
    display: none !important;
}

html.qpd-modal-open,
body.qpd-modal-open {
    overflow: hidden;
}

.qpd-product-container {
    text-align: center;
}
.qpd-trigger-button {
    text-align: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: inline;
}
.qpd-modal {
    display: none;
}

.qpd-modal.is-open {
    display: block;
}

.qpd-product-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 84%;
    max-width: 1200px;
    max-height: 80vh;
    transform: translate(-50%, -50%);
    padding: 0;
    background-color: white;
    padding: 0 20px 20px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: auto;
}
.qpd-product-modal .qpd-contents {
    padding: 12px;
}
.qpd-product-modal .qpd-layout {
    display: flex;
    flex-direction: row;
    gap: 0;
    justify-content: space-between;
}
.qpd-product-modal .qpd-modal-close {
    position: relative;
    color: black;
    background-color: transparent;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    line-height: 1;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.qpd-product-modal .qpd-header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin: -20px -20px 8px;
    padding: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.72) 65%, rgba(255, 255, 255, 0) 100%);
}
.qpd-product-modal .gallery-col {
    width: 38%;
}
.qpd-product-modal .contents-col {
    width: 60%;
}
.qpd-product-modal .main-image-container {
    width: 96%;
    max-width: 500px;
    display: inline-block;
    margin: auto;
    padding: 0;
}
.qpd-product-modal h3 {
    font-size: 1.3em;
    margin: 0;
    margin-bottom: 12px;
}
.qpd-product-modal .product-price {
    margin-bottom: 12px;
}

.qpd-product-modal .qpd-controls {
    display: flex;
    flex-direction: row;
    gap: 0;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}
.qpd-product-modal .product-selection {
    width: 40%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.qpd-product-modal .qpd-controls select {
    max-width: 80%;
    padding: .5em;
    min-height: 32px;
}
.qpd-product-modal .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-items: end;
    width: 40%;
}
.qpd-product-modal .action-buttons .added_to_cart.wc-forward {
    display: none;
}
.qpd-product-modal .quantity-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: start;
    align-items: center;
    width: 100%;
}
.qpd-product-modal .product-selection button {
    background-color: black;
    color: white;
    border: none;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
}
.qpd-product-modal .quantity-group .qpd-qty-number {
    width: 3rem;
    height: 32px;
    box-sizing: border-box;
    padding: 0 4px;
    text-align: center;
}

.qpd-modal.is-open:not(.qpd-is-closing) .qpd-product-modal {
    animation: qpd-modal-in-desktop 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.qpd-modal.is-open.qpd-is-closing .qpd-product-modal {
    animation: qpd-modal-out-desktop 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes qpd-modal-in-desktop {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes qpd-modal-out-desktop {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.985);
    }
}
.qpd-product-modal .action-buttons button {
    background-color: black;
    color: white;
    border: none;
    cursor: pointer;
    padding: .5em 1em;
}
.qpd-product-modal .product-description {
    font-size: .9rem;
    font-weight: 400;
    margin-top: 12px;
}
.qpd-product-modal .qpd-inner-notice {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #d63638;
    border-radius: 6px;
    background-color: #fcf0f1;
    color: #8a2424;
    font-size: .88rem;
    line-height: 1.4;
}
.qpd-product-modal .qpd-inner-notice.is-visible {
    display: block;
}
.qpd-product-modal .variation-details {
    margin-top: 12px;
}
.qpd-product-modal .variation-details .variation-detail {
    display: none;
    font-size: .9rem;
    line-height: 1.5;
}
.qpd-product-modal .variation-details .variation-detail.is-active {
    display: block;
}
.qpd-product-modal .variation-details .variation-detail p {
    margin: 0;
    margin-bottom: 8px;
}
.qpd-product-modal .product-description p {
    margin: 0;
    margin-bottom: 8px;
    line-height: 1.5em;
}

@media screen and (max-width: 900px) {
    
    
    .qpd-product-modal .quantity-group {
        justify-content: center;
    }
}

@media screen and (max-width: 400px) {
    .qpd-product-modal .product-selection {
        width: 100%;
    }
    .qpd-product-modal .qpd-layout {
        flex-direction: column;
        gap: 12px;
    }
    .qpd-product-modal .gallery-col {
        width: 100%;
    }
    .qpd-product-modal .contents-col {
        width: 100%;
    }
    .qpd-product-modal .qpd-controls {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        margin-bottom: 24px;
    }
    .qpd-product-modal .action-buttons {
        width: 100%;
        flex-direction: row;
        justify-content: space-evenly;
        
    }
    .qpd-product-modal .action-buttons button {
        width: 50%;
        min-height: 44px;
    }
    .qpd-product-modal .qpd-modal-close {
        width: 40px;
        height: 40px;
    }
    .qpd-product-modal .qpd-header {
        min-height: 56px;
        margin: 0;
        padding: 8px 8px 12px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.82) 45%, rgba(255, 255, 255, 0) 100%);
    }
    .qpd-product-modal {
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-height: 76vh;
        border-top: 2px solid rgb(67, 67, 67);
        width: 100%;
        padding: 0;
        overflow: auto;
    }

    .qpd-modal.is-open:not(.qpd-is-closing) .qpd-product-modal {
        transform-origin: bottom center;
        animation: qpd-modal-in-mobile 300ms cubic-bezier(0.16, 0.86, 0.24, 1) both;
    }

    .qpd-modal.is-open.qpd-is-closing .qpd-product-modal {
        transform-origin: bottom center;
        animation: qpd-modal-out-mobile 220ms cubic-bezier(0.4, 0, 1, 1) both;
    }

    @keyframes qpd-modal-in-mobile {
        from {
            opacity: 0;
            transform: translateY(100%) scale(0.96);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    @keyframes qpd-modal-out-mobile {
        from {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        to {
            opacity: 0;
            transform: translateY(100%) scale(0.97);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .qpd-modal.is-open .qpd-product-modal,
    .qpd-modal.is-open.qpd-is-closing .qpd-product-modal {
        animation: none;
    }
}

/* Carousel Styles */
.qpd-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 4px;
}

.qpd-carousel-viewport {
    overflow: hidden;
}

.qpd-carousel-container {
    display: flex;
    gap: 0;
}

.qpd-carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
}

.qpd-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.qpd-carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: background-color 150ms ease;
    font-weight: bold;
    padding: 0;
}

.qpd-carousel-button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.8);
}

.qpd-carousel-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qpd-carousel-prev {
    left: 12px;
}

.qpd-carousel-next {
    right: 12px;
}

.qpd-carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.qpd-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 150ms ease;
}

.qpd-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.qpd-carousel-dot.is-active {
    background: rgba(255, 255, 255, 1);
}