/* ── CBZ Affiliate Theme ─────────────────────────────── */

:root {
    --cbz-primary:   #1e3a5f;
    --cbz-accent:    #c9a227;
    --cbz-green:     #2ecc71;
    --cbz-red:       #e74c3c;
    --cbz-gray-100:  #f8f9fa;
    --cbz-gray-200:  #e9ecef;
    --cbz-gray-400:  #ced4da;
    --cbz-gray-600:  #6c757d;
    --cbz-gray-800:  #343a40;
    --cbz-white:     #ffffff;
    --cbz-radius:    8px;
    --cbz-shadow:    0 2px 12px rgba(0,0,0,.08);
    --cbz-font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --cbz-max-width: 1280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--cbz-font);
    color: var(--cbz-gray-800);
    background: var(--cbz-white);
    line-height: 1.6;
}

a { color: var(--cbz-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Container ─────────────────────────────────────── */
.cbz-container { max-width: var(--cbz-max-width); margin: 0 auto; padding: 0 20px; }

/* ── Header ────────────────────────────────────────── */
.cbz-header {
    background: var(--cbz-primary);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.cbz-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; gap: 20px;
}
.cbz-header__logo { display: flex; align-items: center; }
.cbz-header__logo img { height: 40px; width: auto; }
.cbz-header__site-name { color: var(--cbz-white); font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.cbz-header__nav { display: flex; gap: 24px; }
.cbz-header__nav a { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 500; transition: color .2s; }
.cbz-header__nav a:hover { color: var(--cbz-white); text-decoration: none; }
.cbz-header__actions { display: flex; align-items: center; gap: 16px; }
.cbz-header__search-btn,
.cbz-header__cart { color: rgba(255,255,255,.85); display: flex; align-items: center; position: relative; }
.cbz-header__cart:hover { color: var(--cbz-white); }
.cbz-cart-count {
    position: absolute; top: -8px; right: -10px;
    background: var(--cbz-accent); color: var(--cbz-white);
    font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
    border-radius: 9px; display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

/* ── Buttons ───────────────────────────────────────── */
.cbz-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--cbz-radius);
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: 2px solid transparent; transition: all .2s; text-decoration: none !important;
    font-family: var(--cbz-font);
}
.cbz-btn--primary   { background: var(--cbz-accent); color: var(--cbz-white); border-color: var(--cbz-accent); }
.cbz-btn--primary:hover { background: #b8911f; border-color: #b8911f; }
.cbz-btn--secondary { background: var(--cbz-primary); color: var(--cbz-white); border-color: var(--cbz-primary); }
.cbz-btn--secondary:hover { background: #152b47; border-color: #152b47; }
.cbz-btn--outline   { background: transparent; color: var(--cbz-primary); border-color: var(--cbz-primary); }
.cbz-btn--outline:hover { background: var(--cbz-primary); color: var(--cbz-white); }
.cbz-btn--large     { padding: 14px 28px; font-size: 16px; }
.cbz-btn--sm        { padding: 6px 14px; font-size: 13px; }
.cbz-btn--full      { width: 100%; }
.cbz-btn--added     { background: var(--cbz-green) !important; border-color: var(--cbz-green) !important; }
.cbz-btn:disabled   { opacity: .5; cursor: not-allowed; }

/* ── Hero ──────────────────────────────────────────── */
.cbz-hero {
    background: linear-gradient(135deg, var(--cbz-primary) 0%, #2d5280 100%);
    padding: 80px 0; color: var(--cbz-white);
}
.cbz-hero__content { max-width: 600px; }
.cbz-hero__title   { font-size: clamp(32px, 5vw, 52px); font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.cbz-hero__sub     { font-size: 20px; opacity: .85; margin-bottom: 32px; }
.cbz-hero__actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.cbz-hero__trust   { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; opacity: .8; }

/* ── Sections ──────────────────────────────────────── */
.cbz-section { padding: 60px 0; }
.cbz-section--alt { background: var(--cbz-gray-100); }
.cbz-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.cbz-section__header h2 { font-size: 26px; font-weight: 700; color: var(--cbz-primary); }
.cbz-link { color: var(--cbz-accent); font-weight: 600; font-size: 14px; }

/* ── Product Grid ──────────────────────────────────── */
.cbz-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ── Product Card ──────────────────────────────────── */
.cbz-product-card {
    background: var(--cbz-white);
    border: 1px solid var(--cbz-gray-200);
    border-radius: var(--cbz-radius);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex; flex-direction: column;
}
.cbz-product-card:hover { box-shadow: var(--cbz-shadow); transform: translateY(-2px); }
.cbz-product-card__img  {
    position: relative; display: block;
    padding-top: 75%; overflow: hidden; background: var(--cbz-gray-100);
}
.cbz-product-card__img img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; padding: 8px;
    transition: transform .3s;
}
.cbz-product-card:hover .cbz-product-card__img img { transform: scale(1.04); }
.cbz-product-card__no-img {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-size: 40px; opacity: .3;
}
.cbz-product-card__body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cbz-product-card__name { font-size: 13px; font-weight: 600; color: var(--cbz-gray-800); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cbz-product-card__meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.cbz-product-card__price { font-size: 15px; font-weight: 700; color: var(--cbz-primary); }
.cbz-price--sale { color: var(--cbz-red); }

/* ── Badges ────────────────────────────────────────── */
.cbz-badge {
    font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: .04em;
}
.cbz-badge--green { background: #d4edda; color: #155724; }
.cbz-badge--red   { background: #f8d7da; color: #721c24; }
.cbz-badge--sale  {
    position: absolute; top: 8px; left: 8px; z-index: 1;
    background: var(--cbz-red); color: var(--cbz-white);
    font-size: 10px; padding: 2px 8px; border-radius: 4px;
}

/* ── Skeleton ──────────────────────────────────────── */
.cbz-skeleton {
    min-height: 280px; border-radius: var(--cbz-radius);
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: cbz-shimmer 1.4s infinite;
}
@keyframes cbz-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Shop Layout ───────────────────────────────────── */
.cbz-shop { padding: 40px 0; }
.cbz-shop__header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.cbz-shop__header h1 { font-size: 28px; font-weight: 700; color: var(--cbz-primary); flex: 1; }
.cbz-shop__search input {
    border: 1px solid var(--cbz-gray-400); border-radius: var(--cbz-radius);
    padding: 10px 16px; font-size: 14px; width: 280px; font-family: var(--cbz-font);
}
.cbz-shop__sort select {
    border: 1px solid var(--cbz-gray-400); border-radius: var(--cbz-radius);
    padding: 10px 12px; font-size: 14px; font-family: var(--cbz-font); cursor: pointer;
}
.cbz-shop__layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.cbz-shop__meta { color: var(--cbz-gray-600); font-size: 13px; margin-bottom: 16px; }

/* ── Sidebar Filter ────────────────────────────────── */
.cbz-filter { background: var(--cbz-gray-100); border-radius: var(--cbz-radius); padding: 20px; }
.cbz-filter h3 { font-size: 14px; font-weight: 700; color: var(--cbz-primary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .05em; }
.cbz-filter__list { display: flex; flex-direction: column; gap: 4px; }
.cbz-filter__item { padding: 6px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: background .15s; }
.cbz-filter__item:hover, .cbz-filter__item.active { background: var(--cbz-primary); color: var(--cbz-white); }
.cbz-price-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cbz-price-filter input { border: 1px solid var(--cbz-gray-400); border-radius: 6px; padding: 6px 8px; width: 80px; font-size: 13px; }

/* ── Pagination ────────────────────────────────────── */
.cbz-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 40px; }
.cbz-page-btn { padding: 8px 18px; border: 1px solid var(--cbz-gray-400); border-radius: var(--cbz-radius); cursor: pointer; background: var(--cbz-white); font-family: var(--cbz-font); }
.cbz-page-btn:hover { background: var(--cbz-primary); color: var(--cbz-white); border-color: var(--cbz-primary); }
.cbz-page-info { color: var(--cbz-gray-600); font-size: 13px; }

/* ── Product Detail ────────────────────────────────── */
.cbz-product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 40px 0; }
.cbz-gallery__main { border-radius: var(--cbz-radius); overflow: hidden; background: var(--cbz-gray-100); }
.cbz-gallery__main img { width: 100%; height: 400px; object-fit: contain; padding: 16px; }
.cbz-gallery__thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cbz-gallery__thumb { width: 72px; height: 72px; object-fit: contain; border: 2px solid var(--cbz-gray-200); border-radius: 6px; cursor: pointer; padding: 4px; background: var(--cbz-gray-100); }
.cbz-gallery__thumb.active { border-color: var(--cbz-primary); }
.cbz-product-detail__cats { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.cbz-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--cbz-gray-200); color: var(--cbz-gray-600); }
.cbz-product-detail__title { font-size: 28px; font-weight: 700; line-height: 1.3; margin-bottom: 16px; color: var(--cbz-primary); }
.cbz-product-detail__price { font-size: 26px; font-weight: 700; color: var(--cbz-primary); margin-bottom: 12px; }
.cbz-product-detail__sku { font-size: 12px; color: var(--cbz-gray-600); margin-bottom: 12px; }
.cbz-product-detail__stock { font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.cbz-stock--in  { color: #155724; }
.cbz-stock--out { color: var(--cbz-red); }
.cbz-product-detail__short-desc { font-size: 14px; color: var(--cbz-gray-600); margin-bottom: 20px; line-height: 1.7; }
.cbz-product-detail__actions { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.cbz-qty-selector { display: flex; align-items: center; border: 1px solid var(--cbz-gray-400); border-radius: var(--cbz-radius); overflow: hidden; }
.cbz-qty-btn { width: 40px; height: 44px; border: none; background: var(--cbz-gray-100); cursor: pointer; font-size: 18px; font-family: var(--cbz-font); }
.cbz-qty-selector input { width: 50px; height: 44px; border: none; text-align: center; font-size: 15px; font-family: var(--cbz-font); }
.cbz-product-detail__desc { margin-top: 32px; border-top: 1px solid var(--cbz-gray-200); padding-top: 24px; }
.cbz-product-detail__desc h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.cbz-product-detail__desc p { font-size: 14px; color: var(--cbz-gray-600); margin-bottom: 8px; }

/* ── Trust Badges ──────────────────────────────────── */
.cbz-trust-badges { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px; padding: 12px 0; border-top: 1px solid var(--cbz-gray-200); }
.cbz-trust-badges span { font-size: 12px; color: var(--cbz-gray-600); font-weight: 500; }
.cbz-trust-badges--product { margin-top: 24px; }

/* ── Cart Page ─────────────────────────────────────── */
.cbz-cart-page { padding: 40px 0; }
.cbz-cart-page h1 { font-size: 28px; font-weight: 700; color: var(--cbz-primary); margin-bottom: 32px; }
.cbz-cart-item { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--cbz-gray-200); }
.cbz-cart-item__img { width: 72px; height: 72px; object-fit: contain; border-radius: 6px; background: var(--cbz-gray-100); padding: 4px; flex-shrink: 0; }
.cbz-cart-item__no-img { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; background: var(--cbz-gray-100); border-radius: 6px; font-size: 28px; flex-shrink: 0; }
.cbz-cart-item__info { flex: 1; }
.cbz-cart-item__name { font-size: 14px; font-weight: 600; display: block; margin-bottom: 4px; }
.cbz-cart-item__price { font-size: 13px; color: var(--cbz-gray-600); }
.cbz-cart-item__qty { display: flex; align-items: center; gap: 8px; }
.cbz-cart-item__remove { background: none; border: none; color: var(--cbz-gray-400); cursor: pointer; font-size: 16px; padding: 4px; }
.cbz-cart-item__remove:hover { color: var(--cbz-red); }
.cbz-cart-item__subtotal { font-size: 15px; font-weight: 700; color: var(--cbz-primary); min-width: 80px; text-align: right; }
.cbz-qty-val { min-width: 28px; text-align: center; font-weight: 600; }
.cbz-cart__summary { background: var(--cbz-gray-100); border-radius: var(--cbz-radius); padding: 24px; margin-top: 32px; max-width: 360px; margin-left: auto; }
.cbz-cart__total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; margin-bottom: 20px; }

/* ── Checkout ──────────────────────────────────────── */
.cbz-checkout-page { padding: 40px 0; }
.cbz-checkout-page h1 { font-size: 28px; font-weight: 700; color: var(--cbz-primary); margin-bottom: 32px; }
.cbz-checkout__layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.cbz-checkout__form h2,
.cbz-checkout__summary h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--cbz-primary); }
.cbz-form { display: flex; flex-direction: column; gap: 16px; }
.cbz-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cbz-form__group { display: flex; flex-direction: column; gap: 6px; }
.cbz-form__group label { font-size: 13px; font-weight: 600; color: var(--cbz-gray-600); }
.cbz-form__group input,
.cbz-form__group textarea,
.cbz-form__group select {
    border: 1px solid var(--cbz-gray-400); border-radius: var(--cbz-radius);
    padding: 10px 14px; font-size: 14px; font-family: var(--cbz-font);
    transition: border-color .2s;
}
.cbz-form__group input:focus,
.cbz-form__group textarea:focus,
.cbz-form__group select:focus { outline: none; border-color: var(--cbz-primary); }
.cbz-input--error { border-color: var(--cbz-red) !important; }
.cbz-checkout__summary { background: var(--cbz-gray-100); border-radius: var(--cbz-radius); padding: 24px; position: sticky; top: 84px; }
.cbz-order-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--cbz-gray-200); }
.cbz-order-item img { width: 48px; height: 48px; object-fit: contain; background: var(--cbz-white); border-radius: 6px; padding: 4px; }
.cbz-order-item__info { flex: 1; }
.cbz-order-item__name { font-size: 13px; font-weight: 600; display: block; }
.cbz-order-item__qty { font-size: 12px; color: var(--cbz-gray-600); }
.cbz-order-item__price { font-size: 14px; font-weight: 700; }
.cbz-order-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; padding: 16px 0; margin-bottom: 16px; }

/* ── Modal ─────────────────────────────────────────── */
.cbz-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cbz-modal__content {
    background: var(--cbz-white); border-radius: 16px; padding: 48px 40px;
    max-width: 440px; width: 100%; text-align: center;
}
.cbz-modal__icon { font-size: 56px; margin-bottom: 16px; }
.cbz-modal__content h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.cbz-order-details { background: var(--cbz-gray-100); border-radius: 8px; padding: 16px; margin-top: 16px; text-align: left; font-size: 14px; }
.cbz-order-details p { margin-bottom: 6px; }

/* ── Empty state + Error ───────────────────────────── */
.cbz-empty-state { text-align: center; padding: 60px 20px; color: var(--cbz-gray-600); }
.cbz-empty-state p { font-size: 16px; margin-bottom: 20px; }
.cbz-error { background: #f8d7da; border: 1px solid #f5c6cb; border-radius: var(--cbz-radius); padding: 16px 20px; color: #721c24; margin: 16px 0; }

/* ── Footer ────────────────────────────────────────── */
.cbz-footer { background: var(--cbz-primary); color: rgba(255,255,255,.8); margin-top: 80px; padding: 48px 0 0; }
.cbz-footer__inner { display: grid; grid-template-columns: 1fr auto auto; gap: 48px; padding-bottom: 40px; }
.cbz-footer__brand strong { color: var(--cbz-white); font-size: 18px; display: block; margin-bottom: 8px; }
.cbz-footer__brand p { font-size: 13px; }
.cbz-footer__links { display: flex; flex-direction: column; gap: 8px; }
.cbz-footer__links a { color: rgba(255,255,255,.7); font-size: 13px; }
.cbz-footer__links a:hover { color: var(--cbz-white); }
.cbz-footer__trust { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cbz-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; font-size: 12px; text-align: center; }
.cbz-footer__bottom a { color: var(--cbz-accent); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
    .cbz-shop__layout { grid-template-columns: 1fr; }
    .cbz-shop__sidebar { display: none; }
    .cbz-product-detail { grid-template-columns: 1fr; }
    .cbz-checkout__layout { grid-template-columns: 1fr; }
    .cbz-checkout__summary { position: static; }
    .cbz-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .cbz-header__nav { display: none; }
    .cbz-hero { padding: 48px 0; }
    .cbz-product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .cbz-shop__header { flex-direction: column; align-items: flex-start; }
    .cbz-shop__search input { width: 100%; }
    .cbz-form__row { grid-template-columns: 1fr; }
    .cbz-footer__inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
    .cbz-product-grid { grid-template-columns: 1fr; }
}
