/* ===== popup ===== */
.popup{
    position:fixed;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,.6);
    z-index:10000;
}
.popup-content{
    position:relative;
    width:90%;
    max-width:1050px;
    background:#FFFBF9;
    border-radius:24px;
    padding:0;
    box-shadow:0 8px 32px rgba(0,0,0,.25);
}
.popup-close{
    position:absolute;
    top:18px;
    right:20px;
    font-size:32px;
    line-height:1;
    background:none;
    border:none;
    color:#00009c;
    cursor:pointer;
}

/* ===== layout ===== */
.popup-inner-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:50px;
    align-items:start;
}
@media(max-width:800px){
    .popup-inner-grid{grid-template-columns:1fr;}
}

/* ===== gallery ===== */
.popup-gallery-wrapper{
    width:100%;
    position: sticky;
    top: 0;
    left: 0;
}
.popup-main-image-wrapper{position:relative;}
.popup-main-image img{
    width:100%;
    height:auto;
    border-radius:16px;
}

/* ===== Product Card Wishlist Button ===== */
.container-img {
    position: relative;
    display: block;
}

.card-wishlist-btn {
    position: absolute;
    bottom: -2px;
    right: -10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #00009c;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.card-wishlist-btn:hover {
    background: #ffcafd;
    border-color: #ff589e;
    transform: scale(1.1);
}

.card-wishlist-btn.not-in-wishlist {
    -webkit-text-stroke: 0.3px #00009c;
}

.card-wishlist-btn.in-wishlist {
    background: #ff589e;
    border-color: #ff589e;
    color: white;
}

.card-wishlist-btn.in-wishlist:hover {
    background: #ff6bb3;
    border-color: #ff6bb3;
}

.card-wishlist-btn .wishlist-heart {
    font-size: 16px;
    color: #00009c;
    transition: color 0.3s ease;
}

.card-wishlist-btn:hover .wishlist-heart {
    color: #ff589e;
}

.card-wishlist-btn.in-wishlist .wishlist-heart {
    color: white;
}

.card-wishlist-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Mobile responsive adjustments for card wishlist button */
@media (max-width: 768px) {
    .card-wishlist-btn {
        width: 35px;
        height: 35px;
        bottom: 8px;
        right: 8px;
    }
    
    .card-wishlist-btn .wishlist-heart {
        font-size: 14px;
    }
}
.popup-nav {
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:44px;
    height:44px;
    border:none;
    border-radius:50%;
    background:rgba(255,202,253,.9);
    font-size:28px;
    color:#00009c;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
}

.popup-nav svg {
    height: 24px;
    width: 24px;
    pointer-events: none;

}

.popup-nav.popup-prev svg {
    margin-left: -3px;
}
.popup-nav.popup-next svg {
    margin-right: -3px;
}

.popup-prev{left:-22px;}
.popup-next{right:-22px;}

.popup-gallery-thumbnails{
    margin-top:18px;
    display:flex;
    gap:12px;
}
.popup-gallery-thumbnails img{
    width:80px;
    height:80px;
    object-fit:cover;
    border-radius:10px;
    cursor:pointer;
    border:2px solid transparent;
    transition:border-color .3s ease;
}
.popup-gallery-thumbnails img.active,
.popup-gallery-thumbnails img:hover{border-color:#00009c;}

/* ===== info panel ===== */
.popup-info .popup-title{
    font-family: 'Funky Smile',Helvetica,Arial,Lucida,sans-serif;
    font-size:34px;
    text-transform: uppercase;
    color:#00009c;
    margin:0 0 10px;
}
.popup-info .popup-price{
    font-family:'Montserrat',sans-serif;
    font-size:18px;
    color:#00009c;
    margin:0 0 20px;
}

/* ===== popup tabs ===== */
.popup-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #00009c;
}

.popup-tab-btn {
    flex: 1;
    padding: 10px 15px;
    background: #fff;
    border: none;
    font-family: 'Drawing Doodle',Helvetica,Arial,Lucida,sans-serif;
    font-size: 16px;
    color: #00009c;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.popup-tab-btn.active {
    background: #ffcafd;
    color: #00009c;
    font-weight: bold;
}

.popup-tab-btn:hover:not(.active) {
    background: #f0f8ff;
}

/* Tab content */
.popup-tab-content {
    position: relative;
    margin-top: 30px;
}

.popup-tab-panel {
    display: none;
}

.popup-tab-panel.active {
    display: block;
}

.popup-tab-title {
    font-family: 'Funky Smile',Helvetica,Arial,Lucida,sans-serif;
    color: #00009c;
    /* font-size: 28px; */
    /* color: #00009c; */
    /* margin-bottom: 20px; */
    text-transform: uppercase;
}

/* Bulk discount content styling */
.bulk-discount-content {
    /* padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #ffcafd; */
    text-align: left;
}

.bulk-discount-content h3 {
    font-family: 'Funky Smile', Helvetica, Arial, Lucida, sans-serif;
    font-size: 24px;
    color: #00009c;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    text-align: center;
}

.bulk-discount-content p {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    color: #00009c;
    margin: 0;
    text-align: center;
}

/* Bulk selection section */
.bulk-selection-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ffcafd;
}

.bulk-size-selection,
.bulk-quantity-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bulk-selection-label {
    font-family: 'Funky Smile', Helvetica, Arial, Lucida, sans-serif;
    font-size: 16px;
    color: #00009c;
    text-transform: uppercase;
    margin: 0;
    text-align: center;
}

.bulk-selection-dropdown {
    padding: 8px 15px;
    border: 2px solid #00009c;
    border-radius: 25px;
    background: white;
    color: #00009c;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
    text-align: center;
    width: 100%;
    max-width: 180px;
}

.bulk-selection-dropdown:focus {
    outline: none;
    border-color: #ff589e;
    box-shadow: 0 0 0 3px rgba(255, 88, 158, 0.2);
}

.bulk-selection-dropdown:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* Bulk price calculation */
.bulk-price-calculation {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #ffcafd;
}

.bulk-price-calculation > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bulk-price-calculation > div:last-child {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 2px solid #ffcafd;
}

.bulk-price-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: #00009c;
    font-weight: 500;
}

.bulk-price-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: #00009c;
    font-weight: bold;
}

.bulk-total {
    font-size: 20px;
    color: #ff589e;
}

.stapelkorting-table-title {
    font-family: 'Funky Smile', Helvetica, Arial, Lucida, sans-serif;
    font-size: 20px;
    color: #00009c;
    text-transform: uppercase;
    margin: 0 0 15px 0;
    text-align: center;
}

.stapelkorting-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 20px;
    background: #00009c;
    border-radius: 8px 8px 0 0;
    font-family: 'Funky Smile', Helvetica, Arial, Lucida, sans-serif;
    font-size: 18px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
}

.stapelkorting-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 20px;
    background: white;
    border-bottom: 1px solid #ffcafd;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: #00009c;
    transition: background-color 0.3s ease;
}

.stapelkorting-row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.stapelkorting-row.active {
    background: #fff4fa;
    font-weight: bold;
}

.stapelkorting-col {
    text-align: center;
}

.stapelkorting-header .stapelkorting-col {
    text-align: center;
}

/* Mobile responsive for bulk discount */
@media (max-width: 768px) {
    .bulk-selection-section {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .bulk-selection-label {
        font-size: 14px;
    }
    
    .bulk-selection-dropdown {
        font-size: 14px;
        min-width: 100px;
        max-width: 100%;
    }
    
    .bulk-price-calculation {
        padding: 15px;
    }
    
    .bulk-price-label,
    .bulk-price-value {
        font-size: 14px;
    }
    
    .bulk-total {
        font-size: 18px;
    }
    
    .stapelkorting-table {
        max-width: 100%;
    }
    
    .stapelkorting-table-title {
        font-size: 18px;
    }
    
    .stapelkorting-header,
    .stapelkorting-row {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .stapelkorting-header {
        font-size: 16px;
    }
}

/* ===== sizes ===== */
.popup-sizes{display:flex;flex-direction:column;gap:12px;margin-bottom:40px;}
.popup-sizes label{
    display:block;
    position:relative;
    padding:14px 18px 14px 50px;
    font-family: 'Montserrat', sans-serif;
    font-size:18px;
    line-height:1.2;
    color:#00009c;
    background: white;
    cursor:pointer;
    transition:background-color .3s ease,color .3s ease;
}
.popup-sizes input{position:absolute;left:14px;top:50%;transform:translateY(-50%);appearance:none;width:18px;height:18px;border:3px solid #00009c;border-radius:50%;background:#fff;cursor:pointer;}
.popup-sizes input:checked{background:#ff589e;}
/* .popup-sizes input:checked+span,
.popup-sizes input:checked ~ label{background:#fff4fa;color:#00009c;} */

/* ===== sticky action buttons ===== */
.popup-actions-sticky {
    position: sticky;
    bottom: 0;
    background: #FFFBF9;
    border-radius: 0 0 24px 24px;
    padding: 25px 70px 35px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 202, 253, 0.3);
    margin-top: auto;
    flex-shrink: 0;
}

.popup-actions {
    display: flex;
    gap: 22px;
    margin: 0;
}

.popup-actions .winkelmand-btn,
.popup-actions .personaliseren-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 50px;
    font-family: 'Drawing Doodle', Helvetica, Arial, Lucida, sans-serif;
    font-size: 24px;
    cursor: pointer;
    transition: background-color .3s ease, color .3s ease, transform .2s ease;
    position: relative;
    overflow: hidden;
}

.popup-actions .winkelmand-btn {
    background: #ffcafd;
    color: #00009c;
}

.popup-actions .winkelmand-btn:hover {
    background: #ff589e;
    color: #fff;
    transform: translateY(-2px);
}

.popup-actions .personaliseren-btn {
    background: #00009c;
    color: #fff;
}

.popup-actions .personaliseren-btn:hover {
    background: #000078;
    transform: translateY(-2px);
}

/* --- popup content structure --- */
.popup-content{
    max-height:90vh;          /* keeps everything inside the viewport */
    display: flex;
    flex-direction: column;
}

.popup-scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 80px 70px 40px;
}

.popup-inner-grid {
    min-height: auto;
}

.popup-main-image-wrapper{
    position:relative;
    width:100%;
    aspect-ratio:178/118;     /* portrait ratio of the card */
    max-height:60vh;          /* scales with viewport instead of a fixed px value */
}

@supports not (aspect-ratio:1/1){
    /* simple fallback for older browsers */
    .popup-main-image-wrapper::before{
        content:'';
        display:block;
        padding-top:150%;     /* ≈178/118 */
    }
}

.popup-main-image{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
}

.popup-main-image img{
    width:100%;
    height:100%;
    object-fit:contain;       /* prevents cropping while filling reserved space */
}

/* ===== product filters ===== */
.product-filters {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 1px solid #00009c;
}

/* Filter header with toggle */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-header h3 {
    font-size: 28px!important;
    margin: 0!important;
    font-family: 'Funky Smile',Helvetica,Arial,Lucida,sans-serif;
    color: #00009c;
    text-transform: uppercase;
}

/* Filter toggle button - hidden on desktop */
.filter-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.filter-toggle:hover {
    background-color: rgba(0, 0, 156, 0.1);
}

.filter-toggle-icon {
    font-size: 16px;
    color: #00009c;
    transition: transform 0.3s ease;
}

/* Filter content */
.filter-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

/* Mobile styles */
@media (max-width: 768px) {
    .product-filters {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .filter-header {
        margin-bottom: 0;
    }
    
    /* Show toggle button on mobile */
    .filter-toggle {
        display: block;
    }
    
    /* Collapsed state on mobile */
    .product-filters:not(.expanded) .filter-content {
        max-height: 0;
        opacity: 0;
        margin-top: 0;
    }
    
    /* Expanded state on mobile */
    .product-filters.expanded .filter-content {
        max-height: 500px; /* Adjust based on your needs */
        opacity: 1;
        margin-top: 20px;
    }
    
    /* Rotate arrow when expanded */
    .product-filters.expanded .filter-toggle-icon {
        transform: rotate(180deg);
    }
    
    /* Default to collapsed on mobile */
    .filter-content {
        max-height: 0;
        opacity: 0;
        margin-top: 0;
    }
}

/* Desktop - always show content */
@media (min-width: 769px) {
    .filter-content {
        max-height: none !important;
        opacity: 1 !important;
        margin-top: 0 !important;
    }
}

/* ===== products header ===== */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ffcafd;
}

.product-count-display {
    font-family: 'Funky Smile',Helvetica,Arial,Lucida,sans-serif;
    font-size: 18px;
    color: #00009c;
    text-transform: uppercase;
}

.total-products {
    font-weight: bold;
    color: #ff589e;
}

.product-sorting {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-sorting label {
    font-family: 'Funky Smile',Helvetica,Arial,Lucida,sans-serif;
    font-size: 16px;
    color: #00009c;
    margin: 0;
    text-transform: uppercase;
}

.sort-dropdown {
    padding: 8px 15px;
    border: 1px solid #00009c;
    border-radius: 25px;
    background: #fff;
    color: #00009c;
    font-family: 'Funky Smile',Helvetica,Arial,Lucida,sans-serif;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.sort-dropdown:hover {
    background: #ffcafd;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #ff589e;
    box-shadow: 0 0 0 3px rgba(255, 88, 158, 0.2);
}

/* Mobile responsive for products header */
@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }
    
    .product-count-display {
        text-align: center;
        font-size: 16px;
    }
    
    .product-sorting {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .product-sorting label {
        font-size: 14px;
    }
    
    .sort-dropdown {
        width: 100%;
        max-width: 250px;
        min-width: unset;
        padding: 10px 15px;
        font-size: 16px;
        text-align: center;
    }
}

.product-filters h3 {
    font-family: 'Funky Smile',Helvetica,Arial,Lucida,sans-serif;
    font-size: 24px;
    color: #00009c;
    margin: 0 0 15px 0;
    text-transform: uppercase;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: #00009c;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    padding-left: 35px;
}

.filter-checkbox-label:hover {
    color: #ff589e;
}

.filter-checkbox {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    appearance: none;
    width: 22px;
    height: 22px;
    border: 3px solid #00009c;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-checkbox:checked {
    background: #00009c;
    border-color: #00009c;
}

.filter-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.filter-checkbox:hover {
    border-color: #ff589e;
}

.checkmark {
    margin-left: 8px;
}

.product-count {
    color: #666;
    font-size: 0.9em;
    margin-left: 5px;
    font-weight: normal;
}

.filter-checkbox-label.no-results {
    opacity: 0.5;
}

.filter-checkbox-label.no-results .product-count {
    color: #999;
}

.filter-checkbox-label.no-results input[type="checkbox"] {
    pointer-events: none;
    opacity: 0.3;
}

/* ===== pagination ===== */
.pagination-container {
    margin-top: 30px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 2px solid #00009c;
    border-radius: 25px;
    background: #fff;
    color: #00009c;
    font-family: 'Drawing Doodle',Helvetica,Arial,Lucida,sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
}

.pagination-btn:hover {
    background: #ffcafd;
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: #00009c;
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-dots {
    padding: 8px 4px;
    color: #00009c;
    font-family: 'Drawing Doodle',Helvetica,Arial,Lucida,sans-serif;
}

.result-count {
    font-family: 'roboto mono', monospace;
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* ===== loading state ===== */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-family: 'Funky Smile',Helvetica,Arial,Lucida,sans-serif;
    font-size: 24px;
    color: #00009c;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    margin: 20px auto 0;
    border: 4px solid #ffcafd;
    border-top: 4px solid #00009c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== responsive design ===== */
@media (max-width: 768px) {
    .product-filters {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .product-filters h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .filter-checkbox-label {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 14px;
        min-width: 38px;
    }
    
    .result-count {
        font-size: 12px;
    }
    
    /* Mobile popup tabs */
    .popup-tab-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .popup-info .popup-title {
        font-size: 28px;
    }
    
    .popup-info .popup-price {
        font-size: 16px;
    }
    
    .bulk-discount-content {
        padding: 15px;
        min-height: 150px;
    }
    
    .bulk-discount-content p {
        font-size: 16px;
    }
    
    /* Mobile popup content and sticky buttons */
    .popup-content {
        padding: 60px 20px 100px;
        margin: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .popup-actions-sticky {
        padding: 20px 20px 25px;
        border-radius: 0 0 20px 20px;
    }
    
    .popup-actions {
        gap: 15px;
    }
    
    .popup-actions .winkelmand-btn,
    .popup-actions .personaliseren-btn {
        font-size: 20px;
        padding: 14px 0;
    }
}