/*
 * W2P child theme overrides (docs/decisions/DEMO-THEME.md). Loaded after
 * shofy's css/theme.css (see ../../config.php), so brand-specific rules
 * below only need to win the cascade on matching specificity, not
 * `!important`. Brand colours themselves mostly come from the
 * `primary_color`/`secondary_color` theme options shofy's own
 * `partials/header-meta.blade.php` turns into `--tp-theme-primary` /
 * `--tp-theme-secondary` CSS variables - this file is the component-level
 * styling Shofy has no equivalent for (print-options panel, B2B screens)
 * plus the 8px radius / spacing / mobile-overflow brief.
 */

:root {
    --w2p-radius: 8px;
    --w2p-radius-sm: 6px;
    --w2p-border: #e5e7eb;
    --w2p-muted: #6b7280;
    --w2p-surface: #ffffff;
    --w2p-accent: var(--tp-theme-secondary, #f26b3a);
    --w2p-brand: var(--tp-theme-primary, #1f2a44);
}

/* ---------- Global: no page should ever need horizontal scroll ---------- */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

img,
svg,
video,
iframe,
table {
    max-width: 100%;
}

.container,
.container-fluid {
    max-width: 100%;
}

/* ---------- Buttons & radius ---------- */
.tp-btn,
.tp-btn-2,
.tp-product-details-add-to-cart-btn,
.tp-product-details-buy-now-btn,
.tp-product-details-customize-btn,
.w2p-options-panel,
.w2p-badge-turnaround,
.w2p-card-from-price,
.w2p-b2b-card,
.w2p-b2b-card .card,
.w2p-tier-table,
.w2p-b2b-subnav,
.btn,
.card,
.form-control,
.form-select {
    border-radius: var(--w2p-radius) !important;
}

/* ---------- Customize button: primary, next to Add to Cart ---------- */
.w2p-primary-actions-row {
    gap: 12px;
    margin-bottom: 15px;
}

.w2p-primary-action,
.tp-product-details-add-to-cart {
    flex: 1 1 220px;
    margin-bottom: 0 !important;
}

.w2p-primary-action > .w2p-customize {
    width: 100%;
    margin-bottom: 0 !important;
}

.tp-product-details-customize-btn {
    --tp-btn-color: #fff;
    display: block;
    width: 100%;
    background-color: var(--w2p-brand);
    border: 1px solid var(--w2p-brand);
    color: var(--tp-btn-color);
    font-size: 16px;
    font-weight: 500;
    padding: 9px 30px;
    text-align: center;
    transition: background-color .2s ease, border-color .2s ease;
}

.tp-product-details-customize-btn:hover {
    background-color: var(--w2p-accent);
    border-color: var(--w2p-accent);
    color: #fff;
}

/* ---------- Print options panel (product page) ---------- */
.w2p-options-panel {
    border: 1px solid var(--w2p-border);
    background: #f8f9fb;
    padding: 20px;
}

.w2p-options-panel-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--w2p-brand);
}

.w2p-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 24px;
    margin-bottom: 16px;
}

.w2p-options-item-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--w2p-muted);
    margin-bottom: 2px;
}

.w2p-options-item-value {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.w2p-badge-turnaround {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(242, 107, 58, .12);
    color: #9a3f1c;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
}

.w2p-badge-turnaround-sm {
    margin-left: 6px;
}

.w2p-tier-table-wrapper {
    overflow-x: auto;
}

.w2p-tier-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--w2p-surface);
}

.w2p-tier-table th,
.w2p-tier-table td {
    border: 1px solid var(--w2p-border);
    padding: 8px 12px;
    font-size: 13px;
    text-align: left;
}

.w2p-tier-table th {
    background: #eef0f4;
    color: var(--w2p-brand);
    font-weight: 600;
}

/* ---------- Product grid/list cards: from-price + turnaround ---------- */
.w2p-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.w2p-card-from-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--w2p-brand);
}

/* ---------- B2B account screens ---------- */
.w2p-b2b-subnav {
    background: #f8f9fb;
    border: 1px solid var(--w2p-border);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.w2p-b2b-subnav-org {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.w2p-b2b-subnav-org-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--w2p-brand);
}

.w2p-b2b-subnav .nav-pills .nav-link {
    border-radius: var(--w2p-radius-sm);
    color: var(--w2p-brand);
    font-size: 14px;
    padding: 6px 14px;
}

.w2p-b2b-subnav .nav-pills .nav-link.active {
    background-color: var(--w2p-brand);
    color: #fff;
}

.w2p-b2b-card {
    border: 1px solid var(--w2p-border);
    background: var(--w2p-surface);
    padding: 20px;
    margin-bottom: 20px;
}

.w2p-b2b-card h2,
.w2p-b2b-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--w2p-brand);
    margin-bottom: 14px;
}

.w2p-b2b-card .table {
    margin-bottom: 0;
}

.w2p-b2b-card .table-responsive {
    overflow-x: auto;
}

.w2p-role-badge {
    display: inline-block;
    background: rgba(31, 42, 68, .1);
    color: var(--w2p-brand);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 3px 10px;
    border-radius: 999px !important;
}

/* ---------- Mobile (<= 390px) ---------- */
@media (max-width: 480px) {
    .w2p-options-grid {
        grid-template-columns: 1fr 1fr;
    }

    .w2p-b2b-subnav-org {
        flex-direction: column;
        align-items: flex-start;
    }

    .tp-product-details-action-item-wrapper {
        flex-wrap: wrap;
    }
}
