/**
 * BIOWOODURNS — Dealer Shop CSS v1.0
 * ====================================
 * Styles for the white-label dealer portal.
 * Reuses design tokens from the main site (Cormorant Garamond + Lato).
 */

/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ds-bg: #f8f6f0;
    --ds-white: #fff;
    --ds-text: #4a4a4a;
    --ds-heading: #1a1a2e;
    --ds-muted: #8a8d82;
    --ds-border: #e4e2dc;
    --ds-primary: #3d6b1f;
    --ds-primary-light: #e8f0e0;
    --ds-accent: #6B8F4A;
    --ds-danger: #C62828;
    --ds-warning: #E65100;
    --ds-success: #2e7d32;
    --ds-font-heading: 'Cormorant Garamond', Georgia, serif;
    --ds-font-body: 'Lato', -apple-system, sans-serif;
    --ds-radius: 6px;
    --ds-shadow: 0 2px 8px rgba(0,0,0,0.06);
    --ds-shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--ds-font-body);
    font-weight: 300;
    background: var(--ds-bg);
    color: var(--ds-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.ds-header {
    background: var(--ds-white);
    border-bottom: 1px solid var(--ds-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.ds-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.ds-header__logos {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ds-header__dealer-logo {
    height: 36px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.ds-header__separator {
    color: var(--ds-border);
    font-size: 20px;
}

.ds-header__bwu-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ds-font-heading);
    font-size: 18px;
    font-weight: 500;
    color: var(--ds-heading);
    text-decoration: none;
    letter-spacing: 1px;
}
.ds-header__bwu-img {
    height: 28px;
    width: auto;
}

.ds-header__nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ds-nav-link {
    font-family: var(--ds-font-body);
    font-size: 13px;
    font-weight: 400;
    color: var(--ds-text);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--ds-radius);
    transition: background 0.2s, color 0.2s;
}

.ds-nav-link:hover {
    background: var(--ds-primary-light);
    color: var(--ds-primary);
}

.ds-nav-link--cart {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ds-cart-badge {
    background: var(--ds-primary);
    color: 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 5px;
}

/* ── Notification bell ── */
.ds-notif-wrap { position: relative; display: flex; align-items: center; }
.ds-notif-btn { background: none; border: none; cursor: pointer; padding: 4px; position: relative; color: var(--ds-muted); transition: color 0.2s; display: flex; align-items: center; }
.ds-notif-btn:hover { color: var(--ds-heading); }
.ds-notif-badge { position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px; background: #E53935; color: #fff; font-size: 9px; font-weight: 700; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.ds-notif-popup { position: absolute; top: calc(100% + 8px); right: -40px; width: 300px; max-height: 380px; overflow-y: auto; background: var(--ds-white); border: 1px solid var(--ds-border); border-radius: var(--ds-radius); box-shadow: var(--ds-shadow-lg); z-index: 200; }
.ds-notif-popup__header { padding: 10px 14px; border-bottom: 1px solid var(--ds-border); display: flex; justify-content: space-between; align-items: center; font-family: var(--ds-font-body); font-size: 12px; font-weight: 400; }
.ds-notif-popup__header a { color: var(--ds-primary); text-decoration: none; font-size: 11px; }
.ds-notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid #f5f5f0; text-decoration: none; color: var(--ds-text); transition: background 0.15s; font-family: var(--ds-font-body); }
.ds-notif-item:hover { background: var(--ds-primary-light); }
.ds-notif-item--unread { background: #f7faf5; }
.ds-notif-item__title { font-size: 12px; font-weight: 400; margin-bottom: 2px; }
.ds-notif-item--unread .ds-notif-item__title { font-weight: 700; }
.ds-notif-item__msg { font-size: 11px; color: var(--ds-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-notif-item__time { font-size: 10px; color: var(--ds-muted); margin-top: 2px; }
.ds-notif-empty { padding: 20px; text-align: center; color: var(--ds-muted); font-size: 12px; font-family: var(--ds-font-body); }

.ds-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ds-lang-switcher {
    display: flex;
    gap: 2px;
}

.ds-lang-link {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--ds-muted);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s;
}

.ds-lang-link:hover { color: var(--ds-heading); }
.ds-lang-link.active { color: var(--ds-heading); font-weight: 700; }

.ds-user-name {
    font-size: 12px;
    color: var(--ds-text);
    font-weight: 400;
}

.ds-auth-link {
    font-size: 12px;
    font-weight: 400;
    color: var(--ds-primary);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--ds-primary);
    border-radius: var(--ds-radius);
    transition: all 0.2s;
}

.ds-auth-link:hover {
    background: var(--ds-primary);
    color: white;
}

/* ══════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════ */
.ds-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.ds-footer {
    border-top: 1px solid var(--ds-border);
    background: var(--ds-white);
    margin-top: auto;
}

.ds-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--ds-muted);
    letter-spacing: 0.5px;
}

.ds-footer__powered a {
    color: var(--ds-primary);
    text-decoration: none;
}

.ds-footer__powered a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════════════
   CATALOG — Product Grid
   ══════════════════════════════════════ */
.ds-page-title {
    font-family: var(--ds-font-heading);
    font-size: 28px;
    font-weight: 400;
    color: var(--ds-heading);
    margin-bottom: 8px;
}

.ds-page-subtitle {
    font-size: 14px;
    color: var(--ds-muted);
    margin-bottom: 32px;
}

.ds-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ds-product-card {
    background: var(--ds-white);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.ds-product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ds-shadow-lg);
}

.ds-product-card--hidden {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(1);
}

.ds-product-card__image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--ds-bg);
}

.ds-product-card__body {
    padding: 16px;
}

.ds-product-card__name {
    font-family: var(--ds-font-heading);
    font-size: 18px;
    font-weight: 500;
    color: var(--ds-heading);
    margin-bottom: 4px;
}

.ds-product-card__category {
    font-size: 11px;
    color: var(--ds-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.ds-product-card__price {
    font-size: 16px;
    font-weight: 400;
    color: var(--ds-primary);
}

.ds-product-card__no-price {
    font-size: 12px;
    color: var(--ds-muted);
    font-style: italic;
}

/* Badges */
.ds-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    margin-right: 4px;
}

.ds-badge--novita { background: #E3F2FD; color: #1565C0; }
.ds-badge--promo  { background: #FFF3E0; color: #E65100; }
.ds-badge--hidden { background: #f5f5f5; color: #999; }

/* ══════════════════════════════════════
   PRODUCT DETAIL
   ══════════════════════════════════════ */
.ds-product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.ds-product-image {
    width: 100%;
    border-radius: var(--ds-radius);
    border: 1px solid var(--ds-border);
}

.ds-product-info__name {
    font-family: var(--ds-font-heading);
    font-size: 32px;
    font-weight: 400;
    color: var(--ds-heading);
    margin-bottom: 8px;
}

.ds-product-info__category {
    font-size: 12px;
    color: var(--ds-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.ds-product-info__price {
    font-size: 28px;
    font-weight: 400;
    color: var(--ds-primary);
    margin-bottom: 24px;
}

.ds-product-info__desc {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ds-text);
    margin-bottom: 24px;
}

/* Variant pills */
.ds-variant-group {
    margin-bottom: 20px;
}

.ds-variant-group__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ds-muted);
    margin-bottom: 8px;
}

.ds-variant-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ds-variant-pill {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ds-text);
    background: var(--ds-white);
    border: 1px solid var(--ds-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.ds-variant-pill:hover {
    border-color: var(--ds-primary);
    color: var(--ds-primary);
}

.ds-variant-pill.active {
    background: var(--ds-primary);
    color: white;
    border-color: var(--ds-primary);
}

.ds-variant-pill.disabled {
    opacity: 0.35;
    text-decoration: line-through;
    pointer-events: none;
}

/* Quantity + Add to cart */
.ds-add-to-cart {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 24px;
}

.ds-qty-input {
    width: 80px;
    padding: 12px;
    text-align: center;
    font-size: 15px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    font-family: var(--ds-font-body);
}

.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--ds-font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    border-radius: var(--ds-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ds-btn--primary {
    background: var(--ds-primary);
    color: white;
}

.ds-btn--primary:hover {
    background: var(--ds-accent);
}

.ds-btn--outline {
    background: transparent;
    color: var(--ds-primary);
    border: 1px solid var(--ds-primary);
}

.ds-btn--outline:hover {
    background: var(--ds-primary);
    color: white;
}

.ds-btn--danger {
    background: var(--ds-danger);
    color: white;
}

.ds-btn--sm {
    padding: 8px 16px;
    font-size: 11px;
}

.ds-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ══════════════════════════════════════
   CART
   ══════════════════════════════════════ */
.ds-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.ds-cart-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ds-muted);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--ds-border);
}

.ds-cart-table td {
    padding: 16px;
    border-bottom: 1px solid var(--ds-border);
    font-size: 14px;
    vertical-align: middle;
}

.ds-cart-table .cart-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--ds-border);
}

.ds-cart-summary {
    max-width: 360px;
    margin-left: auto;
    margin-top: 24px;
    background: var(--ds-white);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding: 24px;
}

.ds-cart-summary__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.ds-cart-summary__row--total {
    border-top: 2px solid var(--ds-heading);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ds-heading);
}

/* ══════════════════════════════════════
   FORMS (Login, Register, Checkout)
   ══════════════════════════════════════ */
.ds-form-card {
    max-width: 480px;
    margin: 40px auto;
    background: var(--ds-white);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding: 40px;
}

.ds-form-card__title {
    font-family: var(--ds-font-heading);
    font-size: 24px;
    font-weight: 400;
    color: var(--ds-heading);
    text-align: center;
    margin-bottom: 28px;
}

.ds-field {
    margin-bottom: 16px;
}

.ds-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ds-muted);
    margin-bottom: 6px;
}

.ds-field label .req { color: var(--ds-danger); }

.ds-field input,
.ds-field textarea,
.ds-field select {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--ds-font-body);
    font-size: 14px;
    font-weight: 300;
    color: var(--ds-heading);
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ds-field input:focus,
.ds-field textarea:focus,
.ds-field select:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(61,107,31,0.08);
}

.ds-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Alerts */
.ds-alert {
    padding: 14px 18px;
    border-radius: var(--ds-radius);
    font-size: 13px;
    margin-bottom: 20px;
}

.ds-alert--success { background: #e8f5e9; border: 1px solid #c8e6c9; color: var(--ds-success); }
.ds-alert--error   { background: #ffebee; border: 1px solid #ffcdd2; color: var(--ds-danger); }
.ds-alert--warning { background: #fff8e1; border: 1px solid #ffe082; color: var(--ds-warning); }

/* ══════════════════════════════════════
   ORDERS LIST
   ══════════════════════════════════════ */
.ds-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ds-white);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    overflow: hidden;
}

.ds-orders-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ds-muted);
    background: var(--ds-bg);
    text-align: left;
    padding: 12px 16px;
}

.ds-orders-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-top: 1px solid var(--ds-border);
}

.ds-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ds-status-badge--nuovo      { background: #E3F2FD; color: #1565C0; }
.ds-status-badge--confermato  { background: #E8F5E9; color: #2E7D32; }
.ds-status-badge--lavorazione { background: #FFF3E0; color: #E65100; }
.ds-status-badge--spedito     { background: #F3E5F5; color: #7B1FA2; }
.ds-status-badge--consegnato  { background: #E0F2F1; color: #00695C; }
.ds-status-badge--annullato   { background: #FFEBEE; color: #C62828; }

/* ══════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════ */
.ds-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ds-muted);
}

.ds-empty__icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.ds-empty__title {
    font-family: var(--ds-font-heading);
    font-size: 22px;
    font-weight: 400;
    color: var(--ds-heading);
    margin-bottom: 8px;
}

.ds-empty__text {
    font-size: 14px;
    margin-bottom: 24px;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .ds-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .ds-product-detail {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ds-header__inner {
        padding: 0 16px;
        gap: 12px;
    }

    .ds-header__nav {
        gap: 0;
    }

    .ds-nav-link {
        padding: 8px 10px;
        font-size: 12px;
    }

    .ds-form-row {
        grid-template-columns: 1fr;
    }

    .ds-form-card {
        padding: 24px 20px;
        margin: 20px auto;
    }

    .ds-cart-summary {
        max-width: 100%;
    }
}

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

    .ds-header__logos {
        gap: 8px;
    }

    .ds-header__bwu-logo {
        font-size: 15px;
    }

    .ds-lang-switcher {
        display: none;
    }
}

/* ═══ PWA Install Banner (Dealer Shop/Admin) ═══ */
.bwu-pwa-banner {
    width: 100%;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.35s ease;
    background: linear-gradient(135deg, #f0f5eb 0%, #e8f0e0 100%);
    border-bottom: 1px solid #d4e2c8;
    z-index: 90;
}
.bwu-pwa-banner--visible { max-height: 80px; opacity: 1; }
.bwu-pwa-banner__inner {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; max-width: 1200px; margin: 0 auto;
}
.bwu-pwa-banner__icon { font-size: 20px; flex-shrink: 0; }
.bwu-pwa-banner__text { font-size: 13px; color: #3d6b1f; flex: 1; line-height: 1.3; }
.bwu-pwa-banner__btn {
    flex-shrink: 0; padding: 6px 18px; background: #3d6b1f; color: #fff;
    border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none;
    white-space: nowrap; transition: background 0.2s;
}
.bwu-pwa-banner__btn:hover { background: #2d5016; }
.bwu-pwa-banner__close {
    flex-shrink: 0; background: none; border: none; font-size: 22px;
    color: #999; cursor: pointer; padding: 0 4px; line-height: 1;
}
.bwu-pwa-banner__close:hover { color: #555; }
@media (max-width: 600px) {
    .bwu-pwa-banner__inner { padding: 8px 12px; gap: 8px; }
    .bwu-pwa-banner__text { font-size: 12px; }
    .bwu-pwa-banner__btn { padding: 5px 12px; font-size: 12px; }
}
