/**
 * bloo.Cards — Physical Card Order Page
 * Styles for the NFC physical card customizer & ordering flow
 *
 * @version 1.0.0
 * @since   2026-04-07
 */

/* ══════════════════════════════════════════
   FONT-FACE — 6 Professional Google Fonts
   ══════════════════════════════════════════ */

/* Inter — Clean geometric sans-serif */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/physical-card/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/physical-card/inter-700.woff2') format('woff2');
}

/* Poppins — Modern rounded sans-serif */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/physical-card/poppins-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/physical-card/poppins-700.woff2') format('woff2');
}

/* Playfair Display — Elegant serif */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/physical-card/playfair-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/physical-card/playfair-700.woff2') format('woff2');
}

/* Montserrat — Strong geometric sans */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/physical-card/montserrat-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/physical-card/montserrat-700.woff2') format('woff2');
}

/* Cormorant Garamond — Refined classic serif */
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/physical-card/cormorant-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/physical-card/cormorant-700.woff2') format('woff2');
}

/* Raleway — Thin elegant sans-serif */
@font-face {
    font-family: 'Raleway';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/physical-card/raleway-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Raleway';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/physical-card/raleway-700.woff2') format('woff2');
}


/* ══════════════════════════════════════════
   LAYOUT — Main container
   ══════════════════════════════════════════ */

.phcard {
    display: flex;
    gap: 20px;
    padding: 12px 0;
    align-items: flex-start;
}

.phcard__preview-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 12px;
}

.phcard__options-zone {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* ══════════════════════════════════════════
   CARD PREVIEW — Real size (85.6 × 53.98mm)
   Credit card ISO/IEC 7810 ID-1
   At 96dpi: 85.6mm = 323.78px, 53.98mm = 204px
   We use 340 × 214 for comfortable display
   ══════════════════════════════════════════ */

.phcard__card {
    /* FIX 2026-09-16 : taille RÉELLE (85.6 × 54 mm) sur desktop, à l'échelle (largeur viewport) sur mobile */
    width: min(85.6mm, 92vw);
    aspect-ratio: 85.6 / 54;
    height: auto;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
    cursor: default;
    transform-style: preserve-3d;
    perspective: 800px;
}

.phcard__card:hover {
    transform: translateY(-4px) rotateX(2deg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.22), 0 8px 20px rgba(0,0,0,0.1);
}

/* ── Material textures ── */

.phcard__card--plexi {
    background: linear-gradient(135deg, rgba(200,210,230,0.6) 0%, rgba(180,195,220,0.45) 40%, rgba(210,220,240,0.55) 100%);
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.phcard__card--plexi::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.2) 100%);
    pointer-events: none;
    z-index: 1;
}
.phcard__card--plexi .phcard__card-name,
.phcard__card--plexi .phcard__card-title,
.phcard__card--plexi .phcard__card-company,
.phcard__card--plexi .phcard__watermark {
    color: #1a1a2e;
}
.phcard__card--plexi .phcard__card-title {
    opacity: 0.65;
}
.phcard__card--plexi .phcard__card-company {
    opacity: 0.45;
}
.phcard__card--plexi .phcard__nfc-icon {
    color: #1a1a2e;
}
.phcard__card--plexi .phcard__card-logo--placeholder {
    color: rgba(26,26,46,0.4);
    border-color: rgba(26,26,46,0.2);
    background: rgba(255,255,255,0.3);
}

.phcard__card--bois-cedre {
    background: linear-gradient(160deg, #8B6914 0%, #A0752E 25%, #C49A3B 50%, #A0752E 75%, #8B6914 100%);
    border: 1px solid rgba(139,105,20,0.3);
}
.phcard__card--bois-cedre::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        95deg,
        transparent 0px,
        rgba(0,0,0,0.03) 1px,
        transparent 2px,
        rgba(0,0,0,0.02) 4px,
        transparent 6px
    );
    pointer-events: none;
    z-index: 1;
}

.phcard__card--bois-santal {
    background: linear-gradient(160deg, #6B3A2A 0%, #8B4F3A 25%, #A0644E 50%, #8B4F3A 75%, #6B3A2A 100%);
    border: 1px solid rgba(107,58,42,0.3);
}
.phcard__card--bois-santal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        92deg,
        transparent 0px,
        rgba(0,0,0,0.04) 1px,
        transparent 3px,
        rgba(0,0,0,0.02) 5px,
        transparent 8px
    );
    pointer-events: none;
    z-index: 1;
}

.phcard__card--metal {
    background: linear-gradient(145deg, #2c2c2c 0%, #3d3d3d 20%, #4a4a4a 40%, #3d3d3d 60%, #2c2c2c 80%, #3d3d3d 100%);
    border: 1px solid rgba(255,255,255,0.1);
}
.phcard__card--metal::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 50%),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(255,255,255,0.015) 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 1;
}

/* ── Card content overlay ── */

.phcard__card-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    color: #ffffff;
}

/* Layout: With Logo */
.phcard__card-content--with-logo {
    gap: 20px;
}

.phcard__card-logo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    padding: 6px;
    flex-shrink: 0;
}

.phcard__card-logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    border: 1.5px dashed rgba(255,255,255,0.25);
}

.phcard__card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* Layout: Without Logo — centered */
.phcard__card-content--no-logo {
    justify-content: center;
    text-align: center;
}
.phcard__card-content--no-logo .phcard__card-info {
    align-items: center;
}

.phcard__card-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phcard__card-title {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.75;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phcard__card-company {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.5;
    margin-top: 2px;
    letter-spacing: 0.03em;
}

/* NFC chip icon */
.phcard__nfc-icon {
    position: absolute;
    bottom: 16px;
    right: 20px;
    z-index: 3;
    width: 24px;
    height: 24px;
    opacity: 0.35;
}

/* bloo logo watermark */
.phcard__watermark {
    position: absolute;
    bottom: 14px;
    left: 20px;
    z-index: 3;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.25;
    color: #fff;
}


/* ══════════════════════════════════════════
   CARD LABEL — below preview
   ══════════════════════════════════════════ */

.phcard__card-label {
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
}
.phcard__card-label strong {
    color: var(--text);
}


/* ══════════════════════════════════════════
   OPTIONS PANEL
   ══════════════════════════════════════════ */

.phcard__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phcard__section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
    padding-bottom: 4px;
}

/* ── Material selector ── */

.phcard__materials {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phcard__material-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.phcard__material-btn:hover {
    border-color: var(--primary);
    background: var(--surface);
}

.phcard__material-btn--active {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(41,121,242,0.12);
}

.phcard__material-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.phcard__material-swatch--plexi {
    background: linear-gradient(135deg, rgba(200,210,230,0.7), rgba(180,195,220,0.5));
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.3), inset 0 -1px 3px rgba(0,0,0,0.05);
}
.phcard__material-swatch--bois-cedre {
    background: linear-gradient(135deg, #8B6914, #C49A3B);
}
.phcard__material-swatch--bois-santal {
    background: linear-gradient(135deg, #6B3A2A, #A0644E);
}
.phcard__material-swatch--metal {
    background: linear-gradient(135deg, #2c2c2c, #4a4a4a);
}

.phcard__material-info {
    flex: 1;
    min-width: 0;
}

.phcard__material-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.phcard__material-desc {
    font-size: 11px;
    color: var(--text-sub);
    line-height: 1.3;
}

.phcard__material-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.phcard__material-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.phcard__material-btn--active .phcard__material-check {
    display: flex;
}


/* ── Layout toggle ── */

.phcard__layouts {
    display: flex;
    gap: 8px;
}

.phcard__layout-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.phcard__layout-btn:hover {
    border-color: var(--primary);
}

.phcard__layout-btn--active {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(41,121,242,0.12);
}

.phcard__layout-icon {
    width: 64px;
    height: 40px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 4px 6px;
    gap: 4px;
}

.phcard__layout-icon--with-logo .phcard__layout-icon-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--primary);
    opacity: 0.4;
    flex-shrink: 0;
}

.phcard__layout-icon--with-logo .phcard__layout-icon-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.phcard__layout-icon-line {
    height: 3px;
    border-radius: 2px;
    background: var(--text-sub);
    opacity: 0.25;
}
.phcard__layout-icon-line:first-child {
    width: 80%;
    opacity: 0.4;
}

.phcard__layout-icon--no-logo {
    justify-content: center;
}

.phcard__layout-icon--no-logo .phcard__layout-icon-lines {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
}

.phcard__layout-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-sub);
}

.phcard__layout-btn--active .phcard__layout-label {
    color: var(--primary);
}


/* ── Font selector ── */

.phcard__fonts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.phcard__font-btn {
    padding: 8px 10px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.phcard__font-btn:hover {
    border-color: var(--primary);
    background: var(--surface);
}

.phcard__font-btn--active {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(41,121,242,0.12);
}

.phcard__font-preview {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 2px;
}

.phcard__font-name {
    font-size: 9px;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ══════════════════════════════════════════
   ORDER BUTTON
   ══════════════════════════════════════════ */

.phcard__order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--primary), #7c5cfc);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(41,121,242,0.3);
}

.phcard__order-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(41,121,242,0.4);
}

.phcard__order-btn:active {
    transform: translateY(0);
}

.phcard__order-price {
    font-size: 18px;
    font-weight: 800;
}


/* ══════════════════════════════════════════
   DARK MODE
   ══════════════════════════════════════════ */

[data-theme="dark"] .phcard__card {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
}

[data-theme="dark"] .phcard__card:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.25);
}


/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* ══════════════════════════════════════════
   SHOPPING CART ITEMS
   ══════════════════════════════════════════ */

.phcart__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    transition: all 0.2s ease;
}

.phcart__item:hover {
    border-color: var(--primary);
    background: var(--surface);
}

.phcart__item-swatch {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.phcart__item-info {
    flex: 1;
    min-width: 0;
}

.phcart__item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phcart__item-details {
    font-size: 11px;
    color: var(--text-sub);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phcart__item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    white-space: nowrap;
}

.phcart__item-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.phcart__item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}


/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
    .phcard {
        flex-direction: column;
        align-items: center;
    }

    .phcard__preview-zone {
        position: static;
    }

    .phcard__options-zone {
        width: 100%;
        max-width: 400px;
    }
}

/* phcard-mobile-fix : centrage + pas de débordement */
.phcard__preview-zone{max-width:100%;}
@media (max-width:640px){.phcard__card{width:min(85.6mm,94vw);} .phcard__card-name{font-size:15px;}}
