/* ═══════════════════════════════════════════════════════════════════════
   ECommerce / Boutique styles
   À ajouter dans wwwroot/css/app.css ou boutique.css (importé dans app.css)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Badges statut ── */
.ec-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ec-badge-draft     { background: #f1f5f9; color: #64748b; }
.ec-badge-active    { background: #dcfce7; color: #16a34a; }
.ec-badge-archived  { background: #fee2e2; color: #dc2626; }
.ec-badge-confirmed { background: #dbeafe; color: #1d4ed8; }
.ec-badge-processing{ background: #fef3c7; color: #d97706; }
.ec-badge-shipped   { background: #ede9fe; color: #7c3aed; }
.ec-badge-delivered { background: #dcfce7; color: #16a34a; }
.ec-badge-cancelled { background: #f1f5f9; color: #64748b; }
.ec-badge-online    { background: #dbeafe; color: #1d4ed8; }
.ec-badge-instore   { background: #f3f4f6; color: #374151; }

/* ── Stats caisse ── */
.ec-stat-label { font-size:.8rem; color:var(--color-muted); margin-bottom:.25rem; }
.ec-stat-value { font-size:1.25rem; font-weight:700; }

/* ═══════════════════════════════════════════════════════════════════════
   Pages publiques boutique
   ═══════════════════════════════════════════════════════════════════════ */

.shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.shop-hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}
.shop-hero h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: .5rem; }
.shop-hero p  { color: var(--color-muted); font-size: 1.1rem; }

/* ── Layout sidebar + grille ── */
.shop-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 768px) {
    .shop-layout { grid-template-columns: 1fr; }
    .shop-sidebar { display: none; }
}

/* ── Sidebar catégories ── */
.shop-sidebar-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: .75rem;
}
.shop-cat-list, .shop-cat-sub {
    list-style: none;
    padding: 0; margin: 0;
}
.shop-cat-sub { padding-left: 1rem; margin-top: .25rem; }
.shop-cat-link {
    display: block;
    padding: .4rem .5rem;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s;
}
.shop-cat-link:hover  { background: var(--color-surface); }
.shop-cat-link.active { background: var(--color-primary-light, #eff6ff); color: var(--color-primary); font-weight: 600; }

/* ── Toolbar ── */
.shop-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.shop-search {
    flex: 1;
    padding: .6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: .95rem;
    min-width: 200px;
}
.shop-count { font-size: .85rem; color: var(--color-muted); white-space: nowrap; }

/* ── Grille produits ── */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.shop-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
}
.shop-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.08); transform: translateY(-2px); }

.shop-card-img {
    position: relative;
    aspect-ratio: 1;
    background: #f8fafc;
    overflow: hidden;
}
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-img-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: #cbd5e1;
}
.shop-card-badge-oos {
    position: absolute; top: .5rem; left: .5rem;
    background: rgba(0,0,0,.65); color: #fff;
    font-size: .7rem; padding: .15rem .5rem; border-radius: 4px;
}
.shop-card-body { padding: .85rem; }
.shop-card-name { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; line-height: 1.3; }
.shop-card-price { font-size: .95rem; font-weight: 700; color: var(--color-primary); }

.shop-card-skeleton {
    aspect-ratio: .85;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Pagination ── */
.shop-pagination {
    display: flex; justify-content: center; gap: .5rem;
    margin-top: 2rem;
}
.shop-page-link {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--color-border);
    text-decoration: none; color: inherit; font-size: .9rem;
    transition: background .15s;
}
.shop-page-link:hover  { background: var(--color-surface); }
.shop-page-link.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ── Empty state ── */
.shop-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 1rem; padding: 4rem 2rem; color: var(--color-muted); text-align: center;
}

/* ── Fiche produit ── */
.shop-breadcrumb {
    display: flex; gap: .5rem; align-items: center;
    font-size: .85rem; color: var(--color-muted);
    margin-bottom: 1.5rem;
}
.shop-breadcrumb a { color: inherit; text-decoration: none; }
.shop-breadcrumb a:hover { color: var(--color-primary); }

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
@media (max-width: 768px) {
    .product-layout { grid-template-columns: 1fr; gap: 1.5rem; }
}

.product-gallery-main {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: #cbd5e1;
}
.product-gallery-thumbs {
    display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap;
}
.product-thumb {
    width: 60px; height: 60px; border: 2px solid transparent;
    border-radius: 8px; overflow: hidden; cursor: pointer; padding: 0;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb.active { border-color: var(--color-primary); }

.product-title { font-size: 1.75rem; font-weight: 700; margin-bottom: .5rem; }
.product-ref { font-size: .85rem; color: var(--color-muted); margin-bottom: 1rem; }

.product-variants h3, .product-units h3 { font-size: .9rem; font-weight: 600; margin-bottom: .5rem; }
.product-variant-list, .product-units { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }

.product-variant-btn, .product-unit-btn {
    padding: .4rem .9rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    font-size: .9rem;
    transition: border-color .15s;
}
.product-variant-btn:disabled { opacity: .45; cursor: not-allowed; }
.product-variant-btn.selected, .product-unit-btn.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light, #eff6ff);
    color: var(--color-primary);
    font-weight: 600;
}
.product-unit-btn { display: flex; flex-direction: column; align-items: center; }
.unit-price { font-size: .8rem; font-weight: 700; }
.oos-label { font-size: .75rem; color: #dc2626; }

.product-price-block { margin: 1rem 0; }
.product-price { font-size: 1.85rem; font-weight: 800; color: var(--color-primary); }
.product-unit-label { font-size: .9rem; color: var(--color-muted); margin-left: .25rem; }

.product-stock { display: flex; align-items: center; gap: .4rem; font-size: .88rem; margin-bottom: 1.25rem; }
.product-stock.in-stock  { color: #16a34a; }
.product-stock.out-stock { color: #dc2626; }

.product-actions { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; }
.product-qty {
    display: flex; align-items: center; gap: 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px; padding: .35rem .75rem;
}
.product-qty button {
    background: none; border: none; font-size: 1.2rem; cursor: pointer;
    color: var(--color-primary); line-height: 1; padding: 0;
}
.btn-cart { display: flex; align-items: center; gap: .5rem; flex: 1; justify-content: center; }
.product-added-msg {
    padding: .75rem 1rem; background: #dcfce7; color: #16a34a;
    border-radius: 8px; font-size: .9rem; margin-bottom: 1rem;
}
.product-description { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.product-description h3 { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }

/* ── Panier ── */
.cart-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 1rem; padding: 5rem 2rem; text-align: center; color: var(--color-muted);
}
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 768px) {
    .cart-layout { grid-template-columns: 1fr; }
}
.cart-line {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 0; border-bottom: 1px solid var(--color-border);
}
.cart-line-img { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.cart-line-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-info { flex: 1; }
.cart-line-name { font-weight: 600; }
.cart-line-variant { font-size: .85rem; color: var(--color-muted); }
.cart-line-unit { font-size: .85rem; color: var(--color-muted); }
.cart-line-qty {
    display: flex; align-items: center; gap: .75rem;
    border: 1px solid var(--color-border); border-radius: 6px; padding: .25rem .6rem;
}
.cart-line-qty button { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--color-primary); }
.cart-line-total { font-weight: 700; min-width: 100px; text-align: right; }
.cart-line-remove { background: none; border: none; cursor: pointer; color: var(--color-muted); padding: .25rem; }
.cart-line-remove:hover { color: #dc2626; }

.cart-summary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
}
.cart-summary h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.cart-summary-line { display: flex; justify-content: space-between; margin-bottom: .75rem; font-size: .9rem; }
.cart-summary-total {
    display: flex; justify-content: space-between;
    font-size: 1.1rem; font-weight: 700;
    border-top: 1px solid var(--color-border);
    padding-top: .75rem; margin: .75rem 0 1.25rem;
}
.btn-block { width: 100%; justify-content: center; }

/* ── Checkout ── */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }

.checkout-summary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px; padding: 1.5rem;
    position: sticky; top: 1rem;
}
.checkout-summary h3 { font-weight: 700; margin-bottom: 1rem; }
.checkout-line {
    display: flex; justify-content: space-between;
    padding: .5rem 0; border-bottom: 1px solid var(--color-border);
    font-size: .9rem; gap: 1rem;
}
.checkout-line-name { flex: 1; }
.checkout-total {
    display: flex; justify-content: space-between;
    font-weight: 700; font-size: 1.1rem;
    padding-top: .75rem; margin-top: .5rem;
}

.checkout-section { margin-bottom: 1.5rem; }
.checkout-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .35rem; }
.form-control {
    width: 100%; padding: .6rem .9rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px; font-size: .95rem;
}

.payment-methods { display: flex; flex-direction: column; gap: .5rem; }
.payment-method-option {
    display: flex; align-items: center; gap: .75rem;
    padding: .75rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px; cursor: pointer;
    transition: border-color .15s;
}
.payment-method-option input { accent-color: var(--color-primary); }
.payment-method-option.selected { border-color: var(--color-primary); background: var(--color-primary-light, #eff6ff); }
.payment-method-option small { margin-left: auto; color: var(--color-muted); font-size: .8rem; }

.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }
.checkout-back { text-align: center; margin-top: 1rem; font-size: .9rem; }

/* ── Confirmation commande ── */
.order-confirmed {
    display: flex; flex-direction: column; align-items: center;
    gap: 1rem; padding: 5rem 2rem; text-align: center;
}
.order-confirmed-icon {
    width: 80px; height: 80px;
    background: #dcfce7; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #16a34a;
}
.order-confirmed h2 { font-size: 1.75rem; font-weight: 700; }
.order-ref { font-size: 1rem; color: var(--color-muted); }
