/* Product Details Modal Styles */
.product-details-modal[x-cloak] { display: none !important; }

.product-details-modal {
    position: fixed;
    inset: 0;
    z-index: 10000; /* Higher than product selector modal (9999) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-details-modal__backdrop {
    position: absolute;
    inset: 0;
    z-index: 1; /* Base layer within modal */
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.product-details-modal__content {
    position: relative;
    z-index: 2; /* Above backdrop within modal */
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    background-color: var(--bg-modal);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-details-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background-color: transparent;
}

.product-details-modal__header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-details-modal__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.product-details-modal__back:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.product-details-modal__header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-details-modal__type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.product-details-modal__type-icon svg {
    width: 100%;
    height: 100%;
    color: var(--accent);
}

.product-details-modal__type-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-details-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.product-details-modal__close:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.product-details-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px;
    color: var(--text-secondary);
}

.product-details-modal__body {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 28px;
    padding: 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: start;
}

/* Left Column - Gallery + Specs below, sticky zodat specs kan scrollen */
.product-details-modal__left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 0;
    max-height: calc(90vh - 100px); /* Modal hoogte min header/padding */
    overflow: hidden;
}

.product-details-modal__gallery {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.product-details-modal__main-image {
    aspect-ratio: 1;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Navigation arrows */
.product-details-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    z-index: 2;
}

.product-details-modal__main-image:hover .product-details-modal__nav {
    opacity: 1;
}

.product-details-modal__nav:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.product-details-modal__nav--prev {
    left: 8px;
}

.product-details-modal__nav--next {
    right: 8px;
}

.product-details-modal__nav[x-cloak] {
    display: none !important;
}

.product-details-modal__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-details-modal__thumbnails {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.product-details-modal__thumbnail {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-primary);
    overflow: hidden;
    cursor: pointer;
    padding: 2px;
    transition: border-color 0.2s;
}

.product-details-modal__thumbnail.is-active,
.product-details-modal__thumbnail:hover {
    border-color: var(--accent);
}

.product-details-modal__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* Specs - eigen scroll, geen achtergrond */
.product-details-modal__specs {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 0;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.product-details-modal__specs::-webkit-scrollbar {
    width: 5px;
}

.product-details-modal__specs::-webkit-scrollbar-track {
    background: transparent;
}

.product-details-modal__specs::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}

.product-details-modal__specs::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Specs content */
.product-details-modal__specs-groups,
.product-details-modal__specs-table {
    margin: 0;
}

.product-details-modal__section-title {
    display: none;
}

.product-details-modal__specs-table {
    width: 100%;
    border-collapse: collapse;
}

.product-details-modal__specs-table th,
.product-details-modal__specs-table td {
    padding: 4px 0;
    font-size: 0.7rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.product-details-modal__specs-table th {
    color: var(--text-muted);
    font-weight: 400;
    width: 45%;
    padding-right: 10px;
}

.product-details-modal__specs-table td {
    color: var(--text-primary);
    font-weight: 500;
}

.product-details-modal__specs-table tr:last-child th,
.product-details-modal__specs-table tr:last-child td {
    border-bottom: none;
}

/* 2-column grid for specs */
.product-details-modal__specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.product-details-modal__specs-grid .spec-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.product-details-modal__specs-grid .spec-item__label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.product-details-modal__specs-grid .spec-item__value {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.product-details-modal__specs-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-details-modal__specs-group {
    /* No extra background */
}

.product-details-modal__specs-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 4px 0;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border);
}

/* Right Column - geen scroll, bepaalt hoogte van modal */
.product-details-modal__right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
}

.product-details-modal__product-header {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.product-details-modal__product-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

/* Brand - klein, uppercase, muted */
.product-details-modal__product-name > span:first-child {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product name - groter, primaire kleur */
.product-details-modal__product-name > span:last-child {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-details-modal__price-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.product-details-modal__price {
    display: flex;
    flex-direction: column;
}

.product-details-modal__price-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Price + delta on same line, same baseline */
.product-details-modal__price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.product-details-modal__price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

/* Price delta indicator — percentage + "vs 30d" label inline */
.product-details-modal__price .price-delta {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-size: clamp(0.75rem, 0.6vw + 0.35rem, 0.875rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.product-details-modal__price .price-delta__label {
    font-weight: 400;
    opacity: 0.65;
    font-size: 0.85em;
}

.product-details-modal__price .price-delta--low {
    color: var(--success);
}

.product-details-modal__price .price-delta--high {
    color: var(--text-muted);
}

@media (max-width: 360px) {
    .product-details-modal__price .price-delta__label {
        display: none;
    }
}

/* Title Row: Name + Secondary Actions */
.product-details-modal__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.product-details-modal__product-name {
    flex: 1;
    min-width: 0;
}

/* Secondary Actions: Favorite + Open in Tab */
.product-details-modal__secondary-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.product-details-modal__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.product-details-modal__icon-btn:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

/* Favorite Active State */
.product-details-modal__icon-btn.is-favorite {
    color: var(--error);
    border-color: var(--error);
    background-color: var(--error-bg);
}

.product-details-modal__icon-btn.is-favorite:hover {
    background-color: var(--error-bg);
}

/* Copied State */
.product-details-modal__icon-btn.is-copied {
    color: var(--success);
    border-color: var(--success);
    background-color: var(--success-bg, rgba(74, 222, 128, 0.1));
}

.product-details-modal__icon-btn.is-copied:hover {
    background-color: var(--success-bg, rgba(74, 222, 128, 0.15));
}

/* Primary Actions: Add to Build + Buy */
.product-details-modal__primary-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-buy-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: var(--success);
    color: #000;
    font-weight: 600;
    font-size: 0.7rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s;
    min-height: 30px;
}

.btn-buy-now:hover {
    background-color: #3cc96f;
}

.product-details-modal .btn-add-to-build {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: var(--accent);
    color: #000;
    font-weight: 600;
    font-size: 0.7rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 30px;
}

.product-details-modal .btn-add-to-build:hover {
    background-color: var(--accent-hover);
}

/* Stock Badge */
.product-details-modal__stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background-color: var(--error-bg, rgba(248, 113, 113, 0.1));
    color: var(--error, #f87171);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    margin-top: 8px;
}

.product-details-modal__stock-badge--warning {
    background-color: var(--warning-bg, rgba(245, 158, 11, 0.1));
    color: var(--warning, #f59e0b);
}

.product-details-modal__stock-badge[x-cloak] {
    display: none !important;
}

/* Unavailable price actions */
.product-details-modal__price-actions--unavailable .product-details-modal__price-value {
    color: var(--text-muted);
}

/* Out of Stock Notice */
.product-details-modal__out-of-stock {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin: 0 0 16px 0;
    background-color: var(--warning-bg, rgba(245, 158, 11, 0.1));
    border: 1px solid var(--warning, #f59e0b);
    border-radius: 10px;
    color: var(--warning, #f59e0b);
    font-size: 0.875rem;
    font-weight: 500;
}

.product-details-modal__out-of-stock svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.product-details-modal__out-of-stock[x-cloak] {
    display: none !important;
}

/* Variant Selector - Matches merchant feed style */
.variant-selector--modal {
    margin-top: 16px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.variant-selector--modal[x-cloak] {
    display: none !important;
}

.variant-selector--modal .variant-selector__header {
    margin-bottom: 12px;
}

.variant-selector--modal .variant-selector__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.variant-selector--modal .variant-selector__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Variant Cards in Modal - Matches merchant row style */
.variant-selector--modal .variant-card {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
}

.variant-selector--modal .variant-card:hover {
    border-color: var(--accent);
}

.variant-selector--modal .variant-card--active {
    border-color: var(--accent);
    background-color: var(--bg-primary);
}

.variant-selector--modal .variant-card__image {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.variant-selector--modal .variant-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.variant-selector--modal .variant-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.variant-selector--modal .variant-card__name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.variant-selector--modal .variant-card__label-value {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.variant-selector--modal .variant-card__label {
    color: var(--text-muted);
}

.variant-selector--modal .variant-card__value {
    font-weight: 600;
    color: var(--accent);
}

.variant-selector--modal .variant-card__right {
    flex-shrink: 0;
    text-align: right;
    min-width: 60px;
}

.variant-selector--modal .variant-card__badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--accent);
    color: #000;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 4px;
}

.variant-selector--modal .variant-card__price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Variant Selector Collapsed State */
.variant-selector--modal .variant-selector__current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    color: inherit;
}

.variant-selector--modal .variant-selector__current:hover {
    border-color: var(--accent);
}

.variant-selector--modal .variant-selector__current-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.variant-selector--modal .variant-selector__current-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
    background-color: var(--bg-tertiary);
}

.variant-selector--modal .variant-selector__current-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.variant-selector--modal .variant-selector__current-label {
    color: var(--text-muted);
}

.variant-selector--modal .variant-selector__current-value {
    font-weight: 600;
    color: var(--accent);
}

.variant-selector--modal .variant-selector__chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

/* Variant Selector Expanded State */
.variant-selector--modal .variant-selector__expanded {
    margin-top: 12px;
}

.variant-selector--modal .variant-selector__list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.variant-selector--modal .variant-selector__list-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.variant-selector--modal .variant-selector__collapse-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
}

.variant-selector--modal .variant-selector__collapse-btn:hover {
    color: var(--text-primary);
}

.variant-selector--modal .variant-selector__collapse-btn svg {
    flex-shrink: 0;
}

/* Merchants */
.product-details-modal__merchants {
    background-color: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

/* Merchants Table Header - verborgen, niet nodig */
.merchants-table-header {
    display: none;
}

/* Merchants Section Header */
.merchants-header {
    display: none;
}

.merchants-header__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.merchants-header__updated {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.merchants-header__updated[x-cloak] {
    display: none !important;
}

/* Variant Dropdown in merchants header */
.variant-dropdown {
    margin-left: auto;
}

.variant-dropdown__select {
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
    min-width: 160px;
}

.variant-dropdown__select:hover {
    border-color: var(--accent);
    background-color: var(--bg-hover);
}

.variant-dropdown__select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 48, 119, 166), 0.15);
}

.variant-dropdown__select option {
    padding: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.variant-dropdown[x-cloak] {
    display: none !important;
}

.merchants-table {
    display: flex;
    flex-direction: column;
}

/* Merchant row - compact inline zoals /product */
.merchant-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

.merchant-row:last-child {
    border-bottom: none;
}

/* Left section: Logo + Name/Stock */
.merchant-row__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.merchant-row__logo-wrap {
    width: 55px;
    height: 20px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
}

.merchant-row__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
}

.merchant-row__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.merchant-row__name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.merchant-row__name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.merchant-row__lowest-badge {
    display: none; /* Verberg badge - niet nodig */
}

.merchant-row__lowest-badge[x-cloak] {
    display: none !important;
}

/* Geen highlight voor laagste prijs */
.merchant-row--lowest {
    background-color: transparent;
}

/* Amazon row styling - no special background/border, same as other merchants */
.merchant-row__logo-wrap--amazon {
    background-color: transparent;
}

.merchant-row__amazon-note {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.merchant-row__amazon-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* "(vaak goedkoper)" hint for Amazon */
.merchant-row__hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
}

.merchant-row__hint[x-cloak] {
    display: none !important;
}

.merchant-row__stock {
    font-size: 0.7rem;
    font-weight: 500;
}

.merchant-row__stock--in {
    color: var(--success);
}

.merchant-row__stock--out {
    color: var(--error);
}

.merchant-row__stock--unknown {
    color: var(--text-muted);
    font-style: italic;
}

/* Shipping info - verborgen voor compactheid */
.merchant-row__shipping {
    display: none;
}

.merchant-row__shipping[x-cloak] {
    display: none !important;
}

/* Center section: Price */
.merchant-row__center {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    flex-shrink: 0;
    text-align: right;
}

.merchant-row__price-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.merchant-row__price-label {
    display: none;
}

.merchant-row__price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.merchant-row__updated {
    display: none;
}

/* Right section: Buy Button */
.merchant-row__right {
    text-align: right;
}

.btn-merchant-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    background-color: var(--accent);
    color: #000;
    font-weight: 600;
    font-size: 0.7rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
    white-space: nowrap;
    min-height: 26px;
}

.btn-merchant-buy:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.product-details-modal__affiliate-notice {
    margin: 6px 0 0 0;
    padding: 0;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-style: italic;
}

.product-details-modal__no-offers {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
}

/* Price History */
.product-details-modal__price-history {
    background-color: transparent;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 12px 0 0 0;
}

.product-details-modal__price-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.product-details-modal__price-history-header h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Period toggle - zoals /product pagina */
.product-details-modal .price-history__controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-details-modal .price-history__toggle {
    display: flex;
    gap: 4px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    padding: 3px;
}

.product-details-modal .price-history__btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.product-details-modal .price-history__btn:hover {
    color: var(--text-primary);
}

.product-details-modal .price-history__btn.is-active {
    background-color: var(--accent);
    color: #000;
    font-weight: 700;
}

/* Supplier toggle checkbox */
.product-details-modal .price-history__supplier-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.product-details-modal .price-history__supplier-toggle input {
    accent-color: var(--accent);
}

.product-details-modal__chart-wrapper {
    position: relative;
    min-height: 180px;
}

.product-details-modal__chart-container {
    height: 180px;
    position: relative;
}

.product-details-modal__loading-history[x-cloak],
.product-details-modal__no-history[x-cloak] {
    display: none !important;
}

.product-details-modal__chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.product-details-modal__no-history {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    background: transparent;
}

.product-details-modal__no-history svg {
    opacity: 0.5;
}

.product-details-modal__no-history p {
    margin: 0;
}

.product-details-modal__loading-history {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    background: transparent;
    z-index: 1;
}

.price-history-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    padding: 6px 10px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
}

.price-history-stats__item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.price-history-stats__label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.price-history-stats__value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.price-history-stats__value--low {
    color: var(--success);
}

.price-history-stats__value--high {
    color: var(--error);
}

/* Price Alert Button & Popover */
.product-details-modal__alert-wrapper {
    position: relative;
}

.product-details-modal__icon-btn.is-alert-active {
    color: var(--accent);
    border-color: var(--accent);
    background-color: rgba(48, 119, 166, 0.1);
}

.product-details-modal__icon-btn.is-alert-active:hover {
    background-color: rgba(48, 119, 166, 0.15);
}

/* Alert Popover */
.product-details-modal__alert-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow: hidden;
}

html.dark .product-details-modal__alert-popover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.product-details-modal__alert-popover[x-cloak] {
    display: none !important;
}

/* Popover header */
.product-details-modal__alert-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.product-details-modal__alert-popover-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.product-details-modal__alert-popover-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.product-details-modal__alert-popover-close:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Popover body */
.product-details-modal__alert-popover-body {
    padding: 14px;
}

.product-details-modal__alert-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

/* Current price display */
.product-details-modal__alert-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 12px;
}

.product-details-modal__alert-current-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.product-details-modal__alert-current-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
}

/* Alert type selection */
.product-details-modal__alert-types {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.product-details-modal__alert-type {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.product-details-modal__alert-type input {
    display: none;
}

.product-details-modal__alert-type-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.product-details-modal__alert-type:hover {
    border-color: var(--accent);
}

.product-details-modal__alert-type.is-selected {
    background-color: rgba(48, 119, 166, 0.1);
    border-color: var(--accent);
}

.product-details-modal__alert-type.is-selected .product-details-modal__alert-type-label {
    color: var(--accent);
}

/* Input group */
.product-details-modal__alert-input-group {
    margin-bottom: 12px;
}

.product-details-modal__alert-input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.product-details-modal__alert-input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.product-details-modal__alert-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(48, 119, 166, 0.15);
}

.product-details-modal__alert-input {
    flex: 1;
    padding: 8px 10px;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 0;
}

.product-details-modal__alert-input::-webkit-outer-spin-button,
.product-details-modal__alert-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.product-details-modal__alert-input:focus {
    outline: none;
}

.product-details-modal__alert-input-prefix,
.product-details-modal__alert-input-suffix {
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-tertiary);
}

.product-details-modal__alert-input--price {
    text-align: right;
}

/* Error message */
.product-details-modal__alert-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background-color: var(--error-bg, rgba(248, 113, 113, 0.1));
    border-radius: 6px;
    margin-bottom: 12px;
}

.product-details-modal__alert-error[x-cloak] {
    display: none !important;
}

.product-details-modal__alert-error svg {
    flex-shrink: 0;
    color: var(--error);
}

.product-details-modal__alert-error span {
    font-size: 0.75rem;
    color: var(--error);
}

/* Popover footer */
.product-details-modal__alert-popover-footer {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.product-details-modal__alert-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.product-details-modal__alert-btn--cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.product-details-modal__alert-btn--cancel:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.product-details-modal__alert-btn--create {
    background-color: var(--accent);
    border: 1px solid var(--accent);
    color: #000;
}

.product-details-modal__alert-btn--create:hover:not(:disabled) {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.product-details-modal__alert-btn--create:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Existing alert info display */
.product-details-modal__alert-active-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background-color: rgba(48, 119, 166, 0.1);
    border: 1px solid rgba(48, 119, 166, 0.2);
    border-radius: 8px;
    margin-bottom: 12px;
}

.product-details-modal__alert-active-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.product-details-modal__alert-active-text {
    flex: 1;
}

.product-details-modal__alert-active-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.product-details-modal__alert-active-text strong {
    color: var(--accent);
}

/* Delete button */
.product-details-modal__alert-btn--delete {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.product-details-modal__alert-btn--delete:hover:not(:disabled) {
    background-color: var(--error);
    color: #fff;
}

.product-details-modal__alert-btn--delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Single footer (for delete only) */
.product-details-modal__alert-popover-footer--single {
    padding-top: 0;
    border-top: none;
}

/* Account link */
.product-details-modal__alert-account-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.product-details-modal__alert-account-link:hover {
    color: var(--accent);
}

.product-details-modal__alert-account-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.product-details-modal__alert-amazon-notice {
    margin: 0.75rem 0 0;
    padding-top: 0.625rem;
    border-top: 1px dashed var(--border);
    font-size: clamp(0.6875rem, 0.4vw + 0.5rem, 0.75rem);
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

/* === Responsive (was styles-responsive.php) === */
/* Responsive - Tablet */
@media (max-width: 1024px) {
    .product-details-modal__content {
        max-width: 90vw;
        max-height: 85vh;
    }
}

@media (max-width: 900px) {
    .product-details-modal__body {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .product-details-modal__left {
        order: 1;
    }

    .product-details-modal__right {
        order: 2;
    }

    .product-details-modal__gallery {
        order: -1;
    }

    .product-details-modal__specs {
        order: 10;
        max-height: none;
        overflow: visible;
    }

    /* Hide table header on tablet */
    .merchants-table-header {
        display: none;
    }

    .product-details-modal .merchant-row {
        grid-template-columns: minmax(100px, 1fr) auto auto;
    }
}

/* Mobile specific - FULLSCREEN */
@media (max-width: 768px) {
    .product-details-modal {
        padding: 0;
        align-items: stretch;
    }

    .product-details-modal__content {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        animation: modal-slide-up-details 0.3s ease-out;
        overflow: hidden; /* Prevent content overflow */
    }

    /* Sticky header with close button always visible */
    .product-details-modal__header {
        position: sticky;
        top: 0;
        z-index: 10;
        flex-shrink: 0;
        background-color: var(--bg-secondary);
        border-radius: 0;
        padding: 12px 16px;
    }

    .product-details-modal__header-title {
        font-size: 1rem;
    }

    .product-details-modal__body {
        flex: 1 1 auto;
        min-height: 0; /* Critical for flex child scrolling */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 16px;
        padding-bottom: 40px; /* Extra space at bottom for scrolling */
        gap: 16px;
        display: flex;
        flex-direction: column;
        align-items: stretch; /* Voorkom dat items te breed worden */
    }

    /* Restructure mobile layout: Image first, then product info */
    .product-details-modal__left,
    .product-details-modal__right {
        display: contents; /* Allow children to participate in parent flex */
        position: static;
        max-height: none;
        overflow: visible;
        width: 100%;
    }

    .product-details-modal__gallery {
        order: 1; /* Image gallery FIRST */
        flex-shrink: 0;
        width: 100%;
    }

    .product-details-modal__product-header {
        order: 2; /* Product name/price second */
        flex-shrink: 0;
        width: 100%;
    }

    .product-details-modal__merchants {
        order: 3;
        flex-shrink: 0;
        width: 100%;
    }

    /* Variant selector direct onder merchants */
    .variant-selector--modal {
        order: 4 !important;
        width: 100%;
    }

    .product-details-modal__price-history {
        order: 5;
        flex-shrink: 0;
        width: 100%;
    }

    /* Price chart hoger op mobiel */
    .product-details-modal__chart-wrapper {
        min-height: 180px;
    }

    .product-details-modal__chart-container {
        height: 180px;
    }

    .product-details-modal__specs {
        order: 6; /* Specs last on mobile */
        flex-shrink: 0;
        max-height: none;
        overflow: visible;
        margin-bottom: 20px;
        background-color: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        width: 100%;
    }

    /* Hide table header on mobile */
    .merchants-table-header {
        display: none;
    }

    /* Close button larger for touch - always visible top right */
    .product-details-modal__close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Merchant row - mobile compact inline layout */
    .product-details-modal .merchant-row {
        grid-template-columns: minmax(100px, 1fr) auto auto;
        gap: 10px;
        padding: 12px;
        background-color: var(--bg-primary);
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        margin-bottom: 0;
    }

    .product-details-modal .merchant-row:first-child {
        border-radius: 8px 8px 0 0;
    }

    .product-details-modal .merchant-row:last-child {
        border-bottom: none;
        border-radius: 0 0 8px 8px;
    }

    .product-details-modal .merchant-row--lowest {
        background-color: var(--success-bg);
        border-left: 3px solid var(--success);
    }

    .product-details-modal .merchant-row__left {
        gap: 10px;
    }

    .product-details-modal .merchant-row__logo-wrap {
        width: 44px;
        height: 44px;
        padding: 4px;
        background-color: var(--bg-secondary);
        border-radius: 6px;
    }

    .product-details-modal .merchant-row__info {
        gap: 2px;
    }

    .product-details-modal .merchant-row__name {
        font-size: 0.8rem;
    }

    /* Keep hint inline with merchant name on mobile */
    .product-details-modal .merchant-row__name-row {
        flex-wrap: nowrap;
    }

    .product-details-modal .merchant-row__hint {
        font-size: 0.6rem;
    }

    .product-details-modal .merchant-row__stock {
        font-size: 0.7rem;
    }

    /* Amazon label smaller on mobile */
    .product-details-modal .merchant-row__amazon-label {
        font-size: 0.65rem;
    }

    .product-details-modal .merchant-row__shipping {
        display: none;
    }

    .product-details-modal .merchant-row__center {
        text-align: right;
    }

    .product-details-modal .merchant-row__price {
        font-size: 0.9rem;
    }

    .product-details-modal .merchant-row__right {
        width: auto;
    }

    .product-details-modal .btn-merchant-buy {
        min-height: 32px;
        padding: 6px 12px;
        font-size: 0.7rem;
        min-width: 55px;
    }

    .product-details-modal__price-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .product-details-modal__actions {
        flex-direction: column;
    }

    /* Product image - vaste hoogte op mobiel */
    .product-details-modal__main-image {
        aspect-ratio: 1; /* Vierkant */
        height: 250px;
        max-height: 250px;
        width: 100%;
        touch-action: pan-y pinch-zoom;
        user-select: none;
        -webkit-user-select: none;
    }

    .product-details-modal__main-image img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .product-details-modal__main-image img {
        pointer-events: none;
    }

    /* Navigation arrows always visible on mobile */
    .product-details-modal__nav {
        opacity: 1;
    }

    /* Thumbnail strip scrollable horizontally on mobile */
    .product-details-modal__thumbnails {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .product-details-modal__thumbnails::-webkit-scrollbar {
        display: none;
    }

    .product-details-modal__thumbnail {
        flex-shrink: 0;
    }

    /* Variant Selector - Mobile: onder merchant feed */
    .variant-selector--modal {
        order: 4 !important; /* Na merchants, voor price history */
        background: none;
        border: none;
        padding: 0;
        margin-top: 0;
        width: 100%;
    }

    .variant-selector--modal .variant-selector__header {
        margin-bottom: 8px;
    }

    .variant-selector--modal .variant-selector__title {
        font-size: 0.75rem;
    }

    .variant-selector--modal .variant-selector__current {
        padding: 8px 10px;
        border-radius: 6px;
    }

    .variant-selector--modal .variant-selector__current-img {
        width: 32px;
        height: 32px;
    }

    .variant-selector--modal .variant-selector__current-info {
        font-size: 0.75rem;
        gap: 4px;
    }

    .variant-selector--modal .variant-selector__chevron {
        width: 16px;
        height: 16px;
    }

    .variant-selector--modal .variant-card {
        grid-template-columns: 32px 1fr auto;
        gap: 8px;
        padding: 6px 8px;
        border-radius: 6px;
    }

    .variant-selector--modal .variant-card__image {
        width: 32px;
        height: 32px;
    }

    .variant-selector--modal .variant-card__name {
        font-size: 0.7rem;
    }

    .variant-selector--modal .variant-card__label-value {
        font-size: 0.65rem;
    }

    .variant-selector--modal .variant-card__badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .variant-selector--modal .variant-card__price {
        font-size: 0.75rem;
    }

    .variant-selector--modal .variant-selector__list {
        gap: 6px;
    }
}

/* Mobile slide up animation */
@keyframes modal-slide-up-details {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .product-details-modal__body {
        padding: 12px;
    }

    .product-details-modal__product-name {
        font-size: 1rem;
    }

    .product-details-modal__price-value {
        font-size: 1.1rem;
    }

    .btn-buy-now,
    .product-details-modal .btn-add-to-build {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    /* Variant Selector - Small Mobile */
    .variant-selector--modal .variant-card__name {
        display: none; /* Hide product name on very small screens */
    }

    .variant-selector--modal .variant-card__right {
        min-width: auto;
    }

    .variant-selector--modal .variant-card {
        grid-template-columns: 28px 1fr auto;
    }

    .variant-selector--modal .variant-card__image,
    .variant-selector--modal .variant-selector__current-img {
        width: 28px;
        height: 28px;
    }
}

/* Hide "(vaak goedkoper)" hint on very small screens */
@media (max-width: 380px) {
    .merchant-row__hint {
        display: none;
    }
}
