/* Bluhouse Merch — self-contained styles, kept off the global namespace so
   they don't bleed into the Clapat-themed pages. All rules are scoped under
   .merch-page (the <body> class on merch.html). */

.merch-page {
    background: #fff;
    color: #0c0c0c;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

.merch-page * {
    box-sizing: border-box;
}

/* --- Header --- */
.merch-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid rgba(12, 12, 12, 0.08);
}

.merch-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 18px 32px;
}

.merch-logo img {
    height: 44px;
    width: auto;
    display: block;
}

.merch-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.merch-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.merch-nav a {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0c0c0c;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.merch-nav a:hover {
    opacity: 0.55;
}

.merch-nav a.is-current {
    color: #0283eb;
}

.merch-cart-button {
    position: relative;
    background: #0c0c0c;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.merch-cart-button:hover {
    background: #0283eb;
    transform: translateY(-1px);
}

.merch-cart-icon {
    flex-shrink: 0;
}

/* --- Hamburger / mobile menu --- */
.merch-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0 9px;
    background: transparent;
    border: 1px solid rgba(12, 12, 12, 0.15);
    border-radius: 999px;
    cursor: pointer;
}

.merch-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #0c0c0c;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.merch-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.merch-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.merch-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.merch-mobile-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid rgba(12, 12, 12, 0.06);
    border-bottom: 1px solid rgba(12, 12, 12, 0.08);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.merch-mobile-menu.is-open {
    display: flex;
}

.merch-mobile-menu a {
    padding: 15px 18px;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0c0c0c;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(12, 12, 12, 0.06);
}

.merch-mobile-menu a:last-child {
    border-bottom: none;
}

.merch-mobile-menu a.is-current {
    color: #0283eb;
}

@media (min-width: 769px) {
    .merch-mobile-menu {
        display: none !important;
    }
}

.merch-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: #0c0c0c;
    font-size: 11px;
    font-weight: 600;
}

/* --- Hero --- */
.merch-hero {
    padding: 88px 32px 48px;
    max-width: 1480px;
    margin: 0 auto;
}

.merch-hero-tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #0283eb;
    margin-bottom: 18px;
    font-weight: 600;
}

.merch-hero h1 {
    font-size: clamp(38px, 6vw, 84px);
    line-height: 1.02;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.merch-hero p {
    max-width: 620px;
    color: #555;
    font-size: 17px;
    line-height: 1.55;
    margin: 0;
}

.merch-hero .merch-hero-note {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 11px 16px;
    background: rgba(2, 131, 235, 0.07);
    border: 1px solid rgba(2, 131, 235, 0.2);
    border-radius: 10px;
    color: #0a5fb0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
}

.merch-hero-note svg {
    flex-shrink: 0;
}

/* --- Filter bar --- */
.merch-filters {
    position: sticky;
    top: 81px;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid rgba(12, 12, 12, 0.06);
}

.merch-filters-inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    gap: 8px;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.merch-filters-inner::-webkit-scrollbar {
    display: none;
}

.merch-filter {
    background: transparent;
    border: 1px solid rgba(12, 12, 12, 0.15);
    color: #0c0c0c;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.merch-filter:hover {
    border-color: #0c0c0c;
}

.merch-filter.is-active {
    background: #0c0c0c;
    color: #fff;
    border-color: #0c0c0c;
}

/* --- Search --- */
.merch-search-row {
    max-width: 1480px;
    margin: 0 auto;
    padding: 14px 32px 0;
}

.merch-search {
    position: relative;
    display: flex;
    align-items: center;
}

.merch-search-icon {
    position: absolute;
    left: 16px;
    color: #999;
    pointer-events: none;
}

.merch-search-input {
    width: 100%;
    padding: 12px 44px;
    border: 1px solid rgba(12, 12, 12, 0.15);
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    color: #0c0c0c;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease;
}

.merch-search-input::placeholder {
    color: #999;
}

.merch-search-input:focus {
    outline: none;
    border-color: #0c0c0c;
}

.merch-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.merch-search-clear {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(12, 12, 12, 0.08);
    color: #555;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.merch-search-clear:hover {
    background: rgba(12, 12, 12, 0.16);
}

.merch-no-results {
    text-align: center;
    color: #888;
    font-size: 16px;
    padding: 0 32px 80px;
}

/* --- Grid --- */
.merch-grid {
    max-width: 1480px;
    margin: 0 auto;
    padding: 40px 32px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 36px 28px;
}

.merch-card {
    display: flex;
    flex-direction: column;
    background: #fff;
}

.merch-card[hidden] {
    display: none;
}

.merch-carousel {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: #f4f4f4;
    cursor: zoom-in;
}

.merch-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.merch-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.merch-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #0c0c0c;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.merch-carousel-arrow:hover {
    transform: translateY(-50%) scale(1.05);
}

.merch-carousel-arrow.prev {
    left: 12px;
}

.merch-carousel-arrow.next {
    right: 12px;
}

.merch-carousel:hover .merch-carousel-arrow {
    opacity: 1;
}

.merch-carousel-arrow[disabled] {
    opacity: 0.3 !important;
    cursor: default;
}

.merch-carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.merch-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.merch-carousel-dot.is-active {
    background: #fff;
    width: 18px;
}

.merch-card-body {
    padding: 18px 4px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.merch-card-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.merch-card-name {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
    color: #0c0c0c;
}

.merch-card-price {
    font-size: 15px;
    font-weight: 600;
    color: #0c0c0c;
    white-space: nowrap;
}

.merch-card-category {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #888;
    margin: 0;
}

/* --- Variant selectors --- */
.merch-variant {
    margin-top: 0;
}

.merch-variant-label {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.merch-variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.merch-variant-option {
    background: transparent;
    border: 1px solid rgba(12, 12, 12, 0.18);
    color: #0c0c0c;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 38px;
}

.merch-variant-option:hover {
    border-color: #0c0c0c;
}

.merch-variant-option.is-selected {
    background: #0c0c0c;
    color: #fff;
    border-color: #0c0c0c;
}

.merch-add {
    margin-top: auto;
    width: 100%;
    background: #0c0c0c;
    color: #fff;
    border: none;
    padding: 13px 18px;
    border-radius: 8px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.merch-add:hover {
    background: #0283eb;
}

.merch-add.is-added {
    background: #1f9d55;
}

/* --- Lightbox --- */
.merch-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 12, 0.92);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.merch-lightbox.is-open {
    display: flex;
}

.merch-lightbox-inner {
    position: relative;
    max-width: min(960px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.merch-lightbox-image {
    width: min(80vh, 100%);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.merch-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: transparent;
    color: #fff;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.merch-lightbox-nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.merch-lightbox-arrow {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.merch-lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.22);
}

.merch-lightbox-counter {
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* --- Cart drawer --- */
.merch-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.merch-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.merch-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(440px, 100%);
    background: #fff;
    z-index: 95;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.merch-drawer.is-open {
    transform: translateX(0);
}

.merch-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid rgba(12, 12, 12, 0.08);
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    flex-shrink: 0;
}

.merch-drawer-title {
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0;
}

.merch-drawer-close {
    background: transparent;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #0c0c0c;
    padding: 4px 8px;
    line-height: 1;
}

.merch-drawer-body {
    flex: 1 0 auto;
    padding: 16px 24px;
}

.merch-drawer-empty {
    text-align: center;
    color: #888;
    padding: 60px 12px;
    font-size: 14px;
}

.merch-cart-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(12, 12, 12, 0.06);
    align-items: start;
}

.merch-cart-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: #f4f4f4;
}

.merch-cart-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.merch-cart-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.merch-cart-item-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    margin: 0;
}

.merch-cart-item-meta {
    font-size: 11px;
    color: #888;
    letter-spacing: 0.04em;
    margin: 0;
}

.merch-cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.merch-cart-item-price {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.merch-cart-item-unit {
    font-weight: 400;
    color: #888;
}

.merch-cart-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(12, 12, 12, 0.15);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.merch-cart-qty button {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 15px;
    cursor: pointer;
    color: #0c0c0c;
}

.merch-cart-qty span {
    min-width: 24px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.merch-cart-remove {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s ease;
}

.merch-cart-remove:hover {
    color: #b03030;
}

.merch-drawer-footer {
    padding: 20px 24px calc(28px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(12, 12, 12, 0.08);
    background: #fafafa;
    flex-shrink: 0;
}

.merch-cart-subtotal {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
    color: #555;
}

.merch-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #0c0c0c;
}

.merch-delivery-note {
    margin: 0 0 16px;
    padding: 10px 12px 10px 14px;
    background: rgba(217, 31, 31, 0.08);
    border-left: 3px solid #d91f1f;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: #8a1414;
    font-weight: 500;
}

.merch-checkout-form {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.merch-checkout-form label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
}

.merch-checkout-form input,
.merch-checkout-form textarea {
    width: 100%;
    border: 1px solid rgba(12, 12, 12, 0.18);
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #0c0c0c;
    background: #fff;
    transition: border-color 0.15s ease;
}

.merch-checkout-form input:focus,
.merch-checkout-form textarea:focus {
    outline: none;
    border-color: #0c0c0c;
}

.merch-checkout-form textarea {
    resize: vertical;
    min-height: 70px;
}

/* --- Clear-cart toggle --- */
.merch-clear-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 2px;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}

.merch-clear-toggle-text {
    font-size: 12.5px;
    color: #444;
    letter-spacing: 0.01em;
}

.merch-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.merch-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.merch-switch-track {
    position: absolute;
    inset: 0;
    background: #d4d4d4;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.merch-switch-track::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.merch-switch input:checked + .merch-switch-track {
    background: #0c0c0c;
}

.merch-switch input:checked + .merch-switch-track::before {
    transform: translateX(16px);
}

.merch-switch input:focus-visible + .merch-switch-track {
    box-shadow: 0 0 0 3px rgba(2, 131, 235, 0.35);
}

.merch-checkout-submit {
    width: 100%;
    background: #25D366;
    color: #fff;
    border: none;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.merch-checkout-submit:hover {
    background: #1ebd5b;
}

.merch-checkout-submit:disabled {
    background: #c5c5c5;
    cursor: not-allowed;
}

/* --- Footer --- */
.merch-footer {
    border-top: 1px solid rgba(12, 12, 12, 0.08);
    padding: 28px 32px;
    margin-top: 40px;
}

.merch-footer-inner {
    max-width: 1480px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    letter-spacing: 0.06em;
}

.merch-footer-inner a {
    color: #0c0c0c;
    text-decoration: none;
    margin-left: 18px;
}

.merch-footer-inner a:hover {
    color: #0283eb;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .merch-header-inner {
        padding: 14px 18px;
    }
    .merch-logo img {
        height: 32px;
    }
    .merch-nav {
        display: none;
    }
    .merch-menu-toggle {
        display: flex;
    }
    .merch-cart-label {
        display: none;
    }
    .merch-cart-button {
        padding: 9px 12px;
    }
    .merch-hero {
        padding: 48px 18px 28px;
    }
    .merch-hero-tag {
        font-size: 10px;
        margin-bottom: 12px;
    }
    .merch-hero h1 {
        font-size: clamp(28px, 8vw, 40px);
        margin-bottom: 12px;
    }
    .merch-hero p {
        font-size: 14px;
    }
    .merch-hero .merch-hero-note {
        margin-top: 16px;
        font-size: 12.5px;
        padding: 10px 13px;
    }
    .merch-filters {
        top: 73px;
    }
    .merch-search-row {
        padding: 12px 18px 0;
    }
    .merch-filters-inner {
        padding: 12px 18px;
    }
    .merch-grid {
        padding: 28px 18px 60px;
        grid-template-columns: repeat(2, 1fr);
        gap: 22px 12px;
    }
    .merch-card-name,
    .merch-card-price {
        font-size: 13px;
    }
    .merch-carousel-arrow {
        opacity: 1; /* always visible on touch */
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 420px) {
    .merch-grid {
        grid-template-columns: 1fr;
    }
}
