/* The Dingo Daily Store — layered on top of /news/assets/news-styles.css,
   which provides the reset, theme tokens (--bg/--text/--accent/etc, both
   light and dark), nav, footer, and theme toggle. This file only adds
   store-specific components: product grid, product detail page, variant
   picker, and cart drawer. */

/* ── Catalog grid ─────────────────────────────────────────────────────── */
.store-header { max-width: 1200px; margin: 0 auto; padding: 32px 20px 8px; }
.store-header h1 { margin: 0 0 6px; font-size: 32px; }
.store-header p { color: var(--text-secondary); margin: 0; }

.store-grid {
    max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.product-card { display: flex; }
.product-card .card-link {
    text-decoration: none; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: box-shadow var(--transition), border-color var(--transition);
    display: flex; flex-direction: column; width: 100%;
}
.product-card .card-link:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.product-card-image {
    position: relative; display: block; width: 100%; aspect-ratio: 1 / 1;
    overflow: hidden; background: var(--surface);
}
.product-card-body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.product-card-title {
    font-size: 15px; font-weight: 600; margin: 0 0 6px; line-height: 1.35;
    /* Every card reserves exactly two lines for the title (longer ones are
       clipped with an ellipsis) so all cards in the grid stay the same height. */
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
    min-height: calc(1.35em * 2);
}
.product-card-price { font-size: 15px; font-weight: 700; color: var(--accent-text); margin-top: auto; }
.product-card-type {
    display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-secondary); margin-bottom: 6px;
}

/* ── Product detail page ──────────────────────────────────────────────── */
.product-wrapper {
    max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
@media (max-width: 760px) {
    .product-wrapper { grid-template-columns: 1fr; gap: 24px; }
}

.product-gallery-main {
    position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius);
    overflow: hidden; background: var(--surface); margin-bottom: 10px;
    display: block; border: none; padding: 0; cursor: zoom-in;
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-zoom-hint {
    position: absolute; bottom: 10px; right: 10px; width: 34px; height: 34px;
    border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    pointer-events: none;
}
.product-gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.product-gallery-thumb {
    width: 64px; height: 64px; border-radius: 6px; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; background: var(--surface); padding: 0;
    transition: opacity var(--transition);
}
.product-gallery-thumb.active { border-color: var(--accent); }
.product-gallery-thumb.color-hidden { display: none; }
.product-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Lightbox ──────────────────────────────────────────────────────────── */
.lightbox {
    position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
    max-width: 90vw; max-height: 85vh; display: flex; align-items: center; justify-content: center;
    overflow: hidden; touch-action: pan-y;
}
.lightbox-image {
    max-width: 90vw; max-height: 85vh; object-fit: contain; cursor: zoom-in;
    transition: transform 0.2s ease; transform: scale(1); user-select: none;
    -webkit-user-drag: none;
}
.lightbox-image.zoomed { cursor: zoom-out; transform: scale(2); }
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute; background: rgba(255,255,255,0.12); color: #fff; border: none;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 18px; transition: background var(--transition);
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.25); }
.lightbox-close { top: 16px; right: 16px; width: 40px; height: 40px; font-size: 24px; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.8); font-size: 13px;
}
@media (max-width: 600px) {
    .lightbox-prev, .lightbox-next { width: 38px; height: 38px; }
}

.product-info h1 { font-size: 28px; margin: 0 0 10px; }
.product-price { font-size: 24px; font-weight: 700; color: var(--accent-text); margin-bottom: 18px; }
.product-desc {
    color: var(--text-secondary); line-height: 1.6; margin-top: 28px;
    padding-top: 24px; border-top: 1px solid var(--border);
}
.product-desc p { margin: 0 0 10px; }

.variant-group { margin-bottom: 18px; }
.variant-group-label {
    display: block; font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.03em; margin-bottom: 8px; color: var(--text-secondary);
}
.variant-options { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-option {
    padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 6px;
    background: var(--surface); cursor: pointer; font-size: 14px; font-family: inherit;
    color: var(--text); transition: border-color var(--transition), color var(--transition);
}
.variant-option:hover { border-color: var(--accent); }
.variant-option.selected { border-color: var(--accent-contrast); color: var(--accent-text); font-weight: 700; }
.variant-option.unavailable { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

.product-actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.qty-input {
    width: 56px; padding: 10px 8px; text-align: center; border: 1.5px solid var(--border);
    border-radius: 6px; font-size: 15px; font-family: inherit; background: var(--surface); color: var(--text);
}
.add-to-cart-btn {
    flex: 1; padding: 14px 20px; border: none; border-radius: 8px;
    background: var(--accent-contrast); color: #fff; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: filter var(--transition);
}
.add-to-cart-btn:hover { filter: brightness(1.08); }
.add-to-cart-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.add-to-cart-feedback { font-size: 13px; color: var(--text-secondary); margin-top: 10px; min-height: 18px; }

.product-sku { font-size: 12px; color: var(--text-secondary); margin-top: 14px; }

/* ── Cart drawer ──────────────────────────────────────────────────────── */
.cart-toggle {
    position: relative; background: none; border: none; cursor: pointer;
    color: var(--text); font-size: 20px; padding: 8px; display: inline-flex; align-items: center;
}
.cart-count {
    position: absolute; top: 2px; right: 2px; background: var(--accent-contrast); color: #fff;
    font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.cart-count[hidden] { display: none; }

.cart-drawer {
    position: fixed; top: 0; right: 0; height: 100%; width: 360px; max-width: 92vw;
    background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--shadow-md);
    transform: translateX(100%); transition: transform 0.25s ease; z-index: 200;
    display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.cart-drawer-header h2 { margin: 0; font-size: 18px; }
.cart-drawer-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }
.cart-drawer-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-empty { color: var(--text-secondary); padding: 30px 0; text-align: center; }
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-item-image { width: 60px; height: 60px; border-radius: 6px; overflow: hidden; background: var(--surface); flex-shrink: 0; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-title { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.cart-item-variant { font-size: 12px; color: var(--text-secondary); margin: 0 0 6px; }
.cart-item-row { display: flex; justify-content: space-between; align-items: center; }
.cart-item-qty { display: flex; align-items: center; gap: 6px; }
.cart-item-qty button {
    width: 22px; height: 22px; border: 1px solid var(--border); background: var(--surface);
    border-radius: 4px; cursor: pointer; color: var(--text); font-size: 13px; line-height: 1;
}
.cart-item-remove { background: none; border: none; color: var(--text-secondary); font-size: 12px; cursor: pointer; text-decoration: underline; }
.cart-drawer-footer { padding: 16px 20px 20px; border-top: 1px solid var(--border); }
.cart-total-row { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 14px; }
.cart-checkout-btn {
    display: block; width: 100%; padding: 14px; border: none; border-radius: 8px;
    background: var(--accent-contrast); color: #fff; font-size: 15px; font-weight: 700;
    cursor: pointer; text-align: center;
}
.cart-checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cart-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 190;
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

/* Staging-only badge — visible reminder this build isn't live yet. Removed
   at the same time the store gets mounted into production (see ROADMAP.md). */
.store-staging-badge {
    background: #b45309; color: #fff; text-align: center; font-size: 12px;
    font-weight: 700; padding: 6px; letter-spacing: 0.02em;
}

/* ── Free-shipping banner, shipping/returns page, promo + shipping progress in the cart ── */
.store-promo-banner {
    background: var(--accent); color: #fff; text-align: center;
    padding: 9px 16px; font-size: 14px; line-height: 1.4;
}
.store-promo-banner a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.store-promo-banner-sep { opacity: .7; margin: 0 4px; }

.store-policy { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; line-height: 1.7; }
.store-policy h1 { margin: 0 0 4px; font-size: 32px; }
.store-policy h2 { margin: 30px 0 8px; font-size: 20px; }
.store-policy p, .store-policy li { color: var(--text); }
.store-policy ul { padding-left: 22px; }
.store-policy-updated { color: var(--text-secondary); font-size: 13px; margin: 0 0 8px; }

.cart-shipping-progress { margin: 0 0 14px; }
.cart-shipping-progress-text { margin: 0 0 6px; font-size: 13px; color: var(--text-secondary); }
.cart-shipping-progress.unlocked .cart-shipping-progress-text { color: var(--accent); font-weight: 600; }
.cart-shipping-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.cart-shipping-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }

.cart-promo-form { display: flex; gap: 8px; margin: 0 0 6px; }
.cart-promo-input {
    flex: 1 1 auto; min-width: 0; padding: 9px 10px; font: inherit; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm, 6px);
    background: var(--bg); color: var(--text); text-transform: uppercase;
}
.cart-promo-input::placeholder { text-transform: none; }
.cart-promo-apply {
    padding: 9px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius-sm, 6px);
    background: var(--surface); color: var(--text);
}
.cart-promo-apply:disabled { opacity: .6; cursor: default; }
.cart-promo-message { margin: 0 0 10px; font-size: 13px; }
.cart-promo-message.ok { color: #1a7f37; }
.cart-promo-message.err { color: #c0392b; }
.cart-promo-remove { background: none; border: 0; padding: 0 0 0 6px; color: var(--text-secondary); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }

.cart-subtotal-row, .cart-discount-row, .cart-shipping-row {
    display: flex; justify-content: space-between; font-size: 14px; color: var(--text-secondary); margin: 0 0 6px;
}
.cart-discount-row { color: #1a7f37; }
.cart-tax-note { margin: 4px 0 12px; font-size: 12px; color: var(--text-secondary); }

/* ── Catalog sort + filter controls ──────────────────────────────────── */
.store-controls {
    max-width: 1200px; margin: 0 auto; padding: 16px 20px 0;
    display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between;
}
.store-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.store-chip {
    min-height: 38px; padding: 0 16px; font: inherit; font-size: 14px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
}
.store-chip:hover { border-color: var(--accent); }
.store-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.store-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); margin-left: auto; }
/* Same pill shape, height and font as the filter chips; the browser's own
   dropdown chrome is replaced with a chevron so it can't look different. */
.store-sort select {
    -webkit-appearance: none; appearance: none;
    min-height: 38px; padding: 0 38px 0 16px; font: inherit; font-size: 14px; color: var(--text);
    border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
    background-color: var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239ca3af' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 15px center;
}
.store-sort select:hover, .store-sort select:focus { border-color: var(--accent); outline: none; }
.product-card[hidden] { display: none; }
.store-empty { max-width: 1200px; margin: 0 auto; padding: 0 20px 60px; color: var(--text-secondary); }

/* ── Order status page ───────────────────────────────────────────────── */
.order-status-form { display: grid; gap: 14px; max-width: 420px; margin: 20px 0 8px; }
.order-status-form label { display: grid; gap: 6px; font-size: 14px; color: var(--text-secondary); }
.order-status-form input {
    padding: 11px 12px; font: inherit; font-size: 16px; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--bg);
}
#os-number { text-transform: uppercase; letter-spacing: .06em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.order-status-error { color: #c0392b; margin: 12px 0 0; }
.order-status-result { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 22px 0 8px; background: var(--surface); }
.order-status-help { margin-top: 28px; color: var(--text-secondary); font-size: 14px; }
.os-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.os-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); }
.os-number { font-size: 22px; font-weight: 800; letter-spacing: .06em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.os-placed { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.os-badge { background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.os-steps { display: flex; list-style: none; padding: 0; margin: 20px 0 6px; gap: 6px; }
.os-steps li { flex: 1; text-align: center; font-size: 12px; color: var(--text-secondary); position: relative; padding-top: 18px; }
.os-steps li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 3px; background: var(--border); }
.os-steps li.done::before, .os-steps li.current::before { background: var(--accent); }
.os-dot { position: absolute; top: 0; left: 50%; width: 13px; height: 13px; margin-left: -6px; border-radius: 50%; background: var(--border); }
.os-steps li.done .os-dot, .os-steps li.current .os-dot { background: var(--accent); }
.os-steps li.current { color: var(--text); font-weight: 700; }
.os-detail { margin: 12px 0; }
.os-tracking ul { margin: 6px 0 0; padding-left: 20px; }
.os-items { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px; }
.os-item, .os-line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.os-totals { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.os-discount { color: #1a7f37; }
.os-total { font-weight: 700; font-size: 15px; }
