/* ============================================
   GRILLE TARIFAIRE B2B - MAISON SORBETTI
   Charte MS-Rapport - Mobile First
   ============================================ */

/* === VARIABLES === */
:root {
    --or: #C9A961;
    --gris-fonce: #3C3C3C;
    --brun: #8B7355;
    --vert: #4A7C59;
    --rouge: #A64253;
    --beige: #F5EFE7;
    --beige-clair: #F9F7F4;
    --gris-clair: #E0E0E0;
    --blanc: #FFFFFF;

    --whatsapp: #25D366;
    --sepa-blue: #6366f1;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gris-fonce);
    background: var(--beige-clair);
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--beige);
    border-top-color: var(--or);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: 20px;
    color: var(--brun);
    font-size: 14px;
}

/* === HEADER === */
.header {
    background: linear-gradient(135deg, var(--or) 0%, var(--brun) 100%);
    color: var(--blanc);
    padding: 24px 16px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.logo {
    width: 80px;
    height: 80px;
    background: var(--blanc);
    border-radius: 50%;
    padding: 8px;
    object-fit: contain;
}

.header-text h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 14px;
    font-style: italic;
    opacity: 0.9;
    margin-top: 4px;
}

.price-notice {
    background: rgba(255, 255, 255, 0.95);
    color: var(--gris-fonce);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    display: inline-block;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-lg);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.badge-vegan {
    background: rgba(74, 124, 89, 0.3);
}

.badge-artisanal {
    background: rgba(255, 255, 255, 0.25);
}

.badge-france {
    background: rgba(166, 66, 83, 0.25);
}

/* === SECTIONS === */
.section {
    padding: 32px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gris-fonce);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--or);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.vegan-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--vert);
    color: var(--blanc);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}

.section-subtitle {
    display: block;
    width: 100%;
    font-size: 14px;
    font-weight: 400;
    color: var(--brun);
    font-style: italic;
    margin-top: 4px;
}

/* === GRILLE PRODUITS (FRUITS) === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* === CARTE PRODUIT === */
.product-card {
    background: var(--blanc);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

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

/* Conteneur image avec badge */
.product-image-wrapper {
    position: relative;
    overflow: hidden;
}

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

/* Badge conditionnement sur l'image */
.colisage-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--or);
    color: var(--blanc);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gris-fonce);
    line-height: 1.3;
    margin-bottom: 8px;
    min-height: 34px;
}

/* Bloc pricing */
.product-pricing {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--or);
}

.price-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--brun);
}

.price-unit {
    font-size: 11px;
    color: var(--brun);
    opacity: 0.8;
}

/* Prix mono-référence */
.price-mono {
    display: block;
    font-size: 13px;
    color: var(--rouge);
    margin-top: 6px;
    font-weight: 600;
}

/* === BADGES STOCK === */
.stock-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.stock-badge.limited {
    background: rgba(166, 66, 83, 0.15);
    color: var(--rouge);
}

.stock-badge.end-stock {
    background: rgba(201, 169, 97, 0.2);
    color: var(--brun);
}

.stock-badge.seasonal {
    background: rgba(74, 124, 89, 0.15);
    color: var(--vert);
}

/* === SECTION BACS === */
.section-bacs {
    background: var(--blanc);
    border-radius: var(--radius-md);
    margin: 16px;
    max-width: calc(1200px - 32px);
    box-shadow: var(--shadow-sm);
}

.bacs-subsection {
    margin-bottom: 24px;
}

.bacs-subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--brun);
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 4px solid var(--or);
}

/* === LISTE PRODUITS (BACS) === */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--beige-clair);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.product-item:hover {
    background: var(--beige);
}

.product-item .product-name {
    font-size: 14px;
    margin-bottom: 0;
    min-height: auto;
    flex: 1;
}

.product-item .product-price {
    font-size: 16px;
    white-space: nowrap;
    margin-left: 12px;
}

.product-item .stock-badge {
    margin-bottom: 0;
    margin-left: 8px;
}

/* === CONDITIONS === */
.section-conditions {
    background: var(--beige);
    border-radius: var(--radius-md);
    margin: 16px;
    max-width: calc(1200px - 32px);
}

.conditions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.condition-card {
    background: var(--blanc);
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 2px solid var(--gris-clair);
    transition: border-color var(--transition);
}

.condition-card:hover {
    border-color: var(--or);
}

.condition-franco {
    border-color: var(--rouge);
    background: rgba(166, 66, 83, 0.05);
}

.condition-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--brun);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.condition-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--gris-fonce);
}

.condition-franco .condition-value {
    color: var(--rouge);
}

.condition-note {
    display: block;
    font-size: 11px;
    color: var(--brun);
    margin-top: 6px;
}

.condition-note-highlight {
    color: var(--rouge);
    font-size: 14px;
    font-weight: 600;
}

.condition-value-small {
    font-size: 16px;
}

.conditions-grid-single {
    display: block;
}

.conditions-grid-single .condition-card {
    max-width: none;
}

/* === CTA SECTION === */
.section-cta {
    text-align: center;
}

.section-cta .section-title {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 0;
}

.cta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.cta-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px;
    background: var(--blanc);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 2px solid transparent;
}

.cta-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.cta-compte {
    border-color: var(--or);
}

.cta-compte:hover {
    background: rgba(201, 169, 97, 0.05);
}

.cta-sepa {
    border-color: var(--sepa-blue);
}

.cta-sepa:hover {
    background: rgba(99, 102, 241, 0.05);
}

.cta-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 16px;
}

.cta-compte .cta-icon {
    background: rgba(201, 169, 97, 0.15);
    color: var(--or);
}

.cta-sepa .cta-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--sepa-blue);
}

.cta-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gris-fonce);
    margin-bottom: 8px;
}

.cta-card p {
    font-size: 13px;
    color: var(--brun);
    line-height: 1.4;
}

/* === FOOTER === */
.footer {
    background: var(--gris-fonce);
    color: var(--blanc);
    padding: 32px 16px;
    text-align: center;
}

.footer-content {
    margin-bottom: 32px;
}

.footer-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    min-height: 52px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.contact-btn:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.contact-whatsapp {
    background: var(--whatsapp);
    color: var(--blanc);
}

.contact-email {
    background: var(--or);
    color: var(--blanc);
}

.footer-note {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.footer-update {
    font-size: 11px;
    opacity: 0.6;
}

.footer-brand {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
    width: 60px;
    height: 60px;
    background: var(--blanc);
    border-radius: 50%;
    padding: 6px;
    margin: 0 auto 12px;
    object-fit: contain;
}

.footer-brand p {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.footer-legal {
    font-size: 10px;
    opacity: 0.5;
}

/* === ERROR STATE === */
.error-container {
    text-align: center;
    padding: 60px 20px;
}

.error-container p {
    color: var(--rouge);
    font-size: 16px;
    margin-bottom: 20px;
}

.error-container button {
    background: var(--or);
    color: var(--blanc);
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    transition: background var(--transition);
}

.error-container button:hover {
    background: var(--brun);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet (480px+) */
@media (min-width: 480px) {
    .header {
        padding: 32px 24px;
    }

    .header-content {
        flex-direction: row;
        justify-content: center;
    }

    .header-text {
        text-align: left;
    }

    .logo {
        width: 90px;
        height: 90px;
    }

    .header-text h1 {
        font-size: 28px;
    }

    .section {
        padding: 40px 24px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .conditions-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-methods {
        flex-direction: row;
        justify-content: center;
    }
}

/* Desktop (768px+) */
@media (min-width: 768px) {
    .header {
        padding: 40px 32px;
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    .header-text h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    .section {
        padding: 48px 32px;
    }

    .section-title {
        font-size: 24px;
    }

    .section-subtitle {
        display: inline;
        width: auto;
        margin-top: 0;
        margin-left: 8px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .product-info {
        padding: 16px;
    }

    .product-name {
        font-size: 14px;
        min-height: 38px;
    }

    .product-price {
        font-size: 20px;
    }

    .section-bacs,
    .section-conditions {
        margin: 24px auto;
    }

    .products-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .footer {
        padding: 48px 32px;
    }

    .footer-title {
        font-size: 24px;
    }
}

/* Large Desktop (1024px+) */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .products-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .cta-card {
        padding: 36px 28px;
    }

    .cta-icon {
        width: 80px;
        height: 80px;
    }

    .cta-card h3 {
        font-size: 18px;
    }
}

/* Extra Large (1200px+) */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .products-list {
        grid-template-columns: repeat(4, 1fr);
    }
}
