/* ─── Merch Store Styles ─── */

/* ─── Merch Nav (unified XO style) ─── */
.merch-nav {
    background: rgba(10,10,10,0.92);
    border-bottom: 1px solid rgba(220,53,69,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1030;
    transition: background 0.3s, border-color 0.3s;
}
.merch-nav.scrolled {
    background: rgba(10,10,10,0.98);
    border-bottom-color: var(--xo-red);
}
.merch-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.merch-nav-brand img {
    height: auto;
    width: auto;
    max-height: 34px;
    max-width: 200px;
}
@media (max-width: 991.98px) {
    .merch-nav-brand img {
        max-height: none;
        max-width: 180px;
    }
}
/* Desktop links (≥992px) */
.merch-nav-desktop {
    display: none;
    align-items: center;
    gap: 0.25rem;
}
@media (min-width: 992px) {
    .merch-nav-desktop { display: flex; }
}
.mnl {
    color: var(--xo-text);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.5rem 0.85rem;
    position: relative;
    transition: color 0.2s;
}
.mnl::after {
    content: ''; position: absolute;
    bottom: 0; left: 0.85rem;
    width: 0; height: 2px;
    background: var(--xo-red);
    transition: width 0.22s;
}
.mnl:hover { color: #fff; }
.mnl:hover::after { width: calc(100% - 1.7rem); }
.mnl.active { color: var(--xo-red); }
.merch-nav-cart {
    position: relative;
    font-size: 1rem;
}
/* Cart icon always visible in nav (left of hamburger on mobile) */
.merch-nav-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d0d0d0;
    text-decoration: none;
    font-size: 1.05rem;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.merch-nav-cart-icon:hover { color: #fff; }
.merch-nav-cart-icon .cart-badge {
    top: 2px;
    right: 2px;
}
.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--xo-red);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
/* Offset fixed nav for main content */
main.merch-main { padding-top: calc(2rem + 56px) !important; }
@media (max-width: 767px) {
    main.merch-main { padding-top: calc(1.25rem + 56px) !important; }
}
.merch-breadcrumb {
    color: var(--xo-text-dim);
    font-size: 0.8rem;
}
.merch-breadcrumb span {
    color: var(--xo-red);
}

/* Product Cards */
.merch-card {
    background: var(--xo-dark-2);
    border: 1px solid var(--xo-border);
    border-top: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease, border-top-color 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.merch-card:hover {
    border-top-color: var(--xo-red);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.merch-card-art {
    height: 160px;
    background: linear-gradient(135deg, var(--xo-dark-3) 0%, #111 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.merch-card-art i {
    font-size: 3rem;
    opacity: 0.3;
    color: var(--xo-text-dim);
    transition: opacity 0.2s, color 0.2s;
}
.merch-card:hover .merch-card-art i {
    opacity: 0.6;
    color: var(--xo-red);
}
.merch-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.merch-card-name {
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}
.merch-card-price {
    color: var(--xo-red);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.merch-card-desc {
    color: var(--xo-text-dim);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.merch-card-footer {
    margin-top: auto;
}

/* Stock badges */
.stock-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.stock-badge-ok      { background: rgba(40,167,69,0.15); color: #28a745; border: 1px solid rgba(40,167,69,0.3); }
.stock-badge-low     { background: rgba(255,193,7,0.15);  color: #ffc107; border: 1px solid rgba(255,193,7,0.3); }
.stock-badge-out     { background: rgba(220,53,69,0.15);  color: #dc3545; border: 1px solid rgba(220,53,69,0.3); }
.stock-badge-backorder { background: rgba(108,117,125,0.15); color: #adb5bd; border: 1px solid rgba(108,117,125,0.3); }

/* Size Pills */
.size-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.size-pill input[type="radio"] {
    display: none;
}
.size-pill label {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--xo-border);
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--xo-text-dim);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.size-pill label:hover {
    border-color: var(--xo-red);
    color: #fff;
}
.size-pill input[type="radio"]:checked + label {
    background: var(--xo-red);
    border-color: var(--xo-red);
    color: #fff;
}

/* Qty controls */
.qty-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.qty-btn {
    background: var(--xo-dark-3);
    border: 1px solid var(--xo-border);
    color: var(--xo-text);
    width: 28px;
    height: 28px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.qty-btn:hover {
    background: var(--xo-red);
    border-color: var(--xo-red);
    color: #fff;
}
.qty-input {
    width: 44px;
    text-align: center;
    background: var(--xo-dark-3);
    border: 1px solid var(--xo-border);
    color: #fff;
    border-radius: 3px;
    padding: 0.2rem 0.25rem;
    font-size: 0.875rem;
}

/* Cart Table */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--xo-text);
    font-size: 0.9rem;
}
.cart-table th {
    border-bottom: 1px solid var(--xo-border);
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    color: var(--xo-text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cart-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--xo-border);
    vertical-align: middle;
}
.cart-table tr:last-child td {
    border-bottom: none;
}
.cart-table .total-row td {
    border-top: 2px solid var(--xo-border);
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}
.cart-remove-btn {
    background: none;
    border: none;
    color: var(--xo-text-dim);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}
.cart-remove-btn:hover {
    color: var(--xo-red);
    background: rgba(220,53,69,0.1);
}

/* Form Controls */
.merch-form-control {
    background: var(--xo-dark-3);
    border: 1px solid var(--xo-border);
    color: #fff;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    width: 100%;
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.merch-form-control:focus {
    outline: none;
    border-color: var(--xo-red);
    box-shadow: 0 0 0 2px rgba(220,53,69,0.15);
    background: var(--xo-dark-3);
    color: #fff;
}
.merch-form-control::placeholder {
    color: var(--xo-text-dim);
}
.merch-form-label {
    color: var(--xo-text-dim);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    display: block;
}

/* Collection Notice */
.collection-notice {
    background: rgba(255, 193, 7, 0.08);
    border-left: 3px solid #ffc107;
    border-radius: 0 4px 4px 0;
    padding: 0.75rem 1rem;
    color: #ffc107;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}
.collection-notice i {
    margin-right: 0.5rem;
}

/* Checkout Card */
.merch-checkout-card {
    background: var(--xo-dark-2);
    border: 1px solid var(--xo-border);
    border-radius: 4px;
    padding: 1.5rem;
}
.merch-checkout-card h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--xo-border);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Order Summary */
.order-summary-table {
    width: 100%;
    font-size: 0.875rem;
    color: var(--xo-text);
}
.order-summary-table tr + tr td {
    padding-top: 0.5rem;
}
.order-summary-table .summary-total td {
    border-top: 1px solid var(--xo-border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}
.order-summary-table td:last-child {
    text-align: right;
    color: #fff;
}

/* Empty State */
.merch-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--xo-text-dim);
}
.merch-empty > i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}
.merch-empty h4 {
    color: var(--xo-text);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 1rem;
}

/* Success / Cancel pages */
.merch-result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}
.merch-result-icon.success { color: #28a745; }
.merch-result-icon.cancel  { color: var(--xo-red); }

/* Flash messages */
.merch-flash {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.merch-flash-success { background: rgba(40,167,69,0.12); border: 1px solid rgba(40,167,69,0.3); color: #28a745; }
.merch-flash-error   { background: rgba(220,53,69,0.12);  border: 1px solid rgba(220,53,69,0.3);  color: #dc3545; }

/* ─── Merch card entrance animation ─── */
.merch-card {
    opacity: 0;
    transform: translateY(20px);
    animation: merch-card-in 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes merch-card-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* Stagger per column position */
.col-sm-6:nth-child(1) .merch-card,
.col-lg-3:nth-child(1) .merch-card { animation-delay: 0.08s; }
.col-sm-6:nth-child(2) .merch-card,
.col-lg-3:nth-child(2) .merch-card { animation-delay: 0.16s; }
.col-sm-6:nth-child(3) .merch-card,
.col-lg-3:nth-child(3) .merch-card { animation-delay: 0.24s; }
.col-sm-6:nth-child(4) .merch-card,
.col-lg-3:nth-child(4) .merch-card { animation-delay: 0.32s; }
.col-sm-6:nth-child(n+5) .merch-card,
.col-lg-3:nth-child(n+5) .merch-card { animation-delay: 0.4s; }

/* Responsive tweaks */
@media (max-width: 767px) {
    /* Tighter spacing in merch pages on mobile */
    .merch-checkout-card { padding: 1rem; }
    .cart-table th, .cart-table td { padding: 0.6rem 0.35rem; }
    .merch-empty { padding: 2.5rem 1rem; }
    .product-detail-grid { gap: 1.25rem; }
    /* Compact card body for 2-column grid on mobile */
    .merch-card-body { padding: 0.75rem; }
    .merch-card-art  { height: 130px; }
    .merch-card-name { font-size: 0.82rem; }
    .merch-card-price { font-size: 1.1rem; }
    .merch-card-desc { display: none; }
}

@media (max-width: 576px) {
    .cart-table th:nth-child(3),
    .cart-table td:nth-child(3) {
        display: none;
    }
    .merch-nav-inner {
        padding: 0 1rem;
    }
    /* Two-column stagger on mobile */
    .col-6:nth-child(odd)  .merch-card { animation-delay: 0.08s; }
    .col-6:nth-child(even) .merch-card { animation-delay: 0.18s; }
}

/* ─── Page headings — left-aligned with accent bar ─── */
.merch-page-heading {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 0;
}
.merch-page-heading::after {
    content: '';
    display: block;
    width: 32px;
    height: 3px;
    background: var(--xo-red);
    margin-top: 0.4rem;
}
@media (max-width: 575px) {
    .merch-page-heading { font-size: 1.25rem; }
}

/* ─── Back / secondary navigation links ─── */
.merch-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--xo-text-dim);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid var(--xo-border);
    padding: 0.42rem 1rem;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.merch-back-link:hover {
    color: #fff;
    border-color: rgba(220,53,69,0.5);
}

/* ─── Product detail back link ─── */
.product-back-link {
    color: var(--xo-text-dim);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.product-back-link:hover { color: var(--xo-red); }

/* ─── Merch shop: nav cart icon (reused in main site nav) ─── */
.xo-nav-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    text-decoration: none;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.xo-nav-cart-icon:hover { color: #fff; }
.xo-nav-cart-icon .cart-badge {
    top: 2px;
    right: 2px;
}
