/* ================================================================
   Multi-Brand Checkout — PHP Rebuild Stylesheet
   ================================================================ */

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

:root {
    --brand-primary: #00d9a7;
    --brand-secondary: #22483f;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --bg: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
    --transition: .2s ease;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-secondary); }

img { max-width: 100%; height: auto; }
input, select, textarea, button { font-family: inherit; font-size: 1rem; }

/* ── Header ── */
.site-header {
    text-align: center;
    padding: 1.5rem 1rem 0.75rem;
}
.brand-logo {
    display: inline-block;
}
.brand-logo img {
    display: block;
    width: auto;
    height: 48px;
    max-width: min(280px, 45vw);
    max-height: 64px;
}
.brand-text { font-size: 1.5rem; font-weight: 700; color: var(--brand-secondary); }

/* ── Footer ── */
.site-footer {
    background: var(--brand-secondary);
    color: rgba(255,255,255,.7);
    padding: 1.5rem;
    margin-top: auto;
    font-size: .85rem;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(255,255,255,.7); }
.footer-links a:hover { color: var(--white); }

/* ── Main Content ── */
.main-content { flex: 1; display: flex; flex-direction: column; }
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
}
.brand-widgets { text-align: center; padding: .5rem 1rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.btn-primary {
    background: var(--brand-primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--brand-secondary);
    color: var(--white);
}
.btn-secondary {
    background: var(--brand-secondary);
    color: var(--white);
}
.btn-secondary:hover { opacity: .9; }
.btn-outline {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: transparent;
}
.btn-outline:hover {
    background: var(--brand-primary);
    color: var(--white);
}
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: .9rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: .45rem 1rem; font-size: .85rem; }

/* ── Alerts ── */
.alert {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: .95rem;
    border-left: 4px solid;
}
.alert-success { background: #ecfdf5; border-color: var(--success); color: #065f46; }
.alert-error   { background: #fef2f2; border-color: var(--error);   color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: var(--warning); color: #92400e; }
.alert-info    { background: #eff6ff; border-color: var(--info);    color: #1e40af; }
.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: .5;
    color: inherit;
}
.alert-close:hover { opacity: 1; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0,217,167,.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.input-row { display: flex; gap: .75rem; }
.input-row input { flex: 1; }
.form-hint { color: var(--text-light); font-size: .9rem; margin-bottom: 1rem; }
.form-feedback { margin-top: .5rem; font-size: .875rem; }
.form-select {
    width: 100%;
    padding: .7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .75rem;
}
.form-check input[type="checkbox"] {
    width: 18px; height: 18px; margin-top: 2px;
    accent-color: var(--brand-primary);
}
.form-checks { margin: 1.5rem 0; }
.form-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.form-section legend {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-secondary);
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    padding: 0;
}

/* ── Stepper ── */
.checkout-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 0;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}
.step-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    color: var(--text-light);
    background: var(--white);
    transition: all var(--transition);
}
.step.active .step-circle {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: var(--white);
}
.step.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: var(--white);
}
.step-label { font-size: .75rem; color: var(--text-light); font-weight: 500; }
.step.active .step-label { color: var(--brand-primary); font-weight: 700; }
.step.completed .step-label { color: var(--success); }
.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 .25rem;
    margin-bottom: 1.25rem;
}
.step-connector.completed { background: var(--success); }

/* ── Home Page ── */
.hero-section {
    text-align: center;
    margin-bottom: 2rem;
}
.hero-section h1 {
    font-size: 2rem;
    color: var(--brand-secondary);
    margin-bottom: .5rem;
}
.hero-section p { color: var(--text-light); font-size: 1.1rem; }

.postcode-form {
    max-width: 500px;
    margin: 0 auto 2rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.address-results {
    max-width: 600px;
    margin: 0 auto;
}
.address-results h2 { margin-bottom: .5rem; color: var(--brand-secondary); }
.results-count { color: var(--text-light); font-size: .9rem; margin-bottom: 1rem; }

.address-list { display: flex; flex-direction: column; gap: .5rem; }
.address-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    font-size: .95rem;
    color: var(--text);
}
.address-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow);
}
.address-card .fa-location-dot { color: var(--brand-primary); }
.address-card span { flex: 1; }
.address-card .fa-chevron-right { color: var(--text-light); font-size: .8rem; }

.preorder-cta {
    text-align: center;
    margin-bottom: 1.5rem;
}
.preorder-cta p { color: var(--text-light); margin-bottom: .5rem; }

/* ── Products Page ── */
.products-header {
    text-align: center;
    margin-bottom: 2rem;
}
.products-header h1 { color: var(--brand-secondary); margin-bottom: .5rem; }
.selected-address { color: var(--text-light); }
.selected-address .fa-location-dot { color: var(--brand-primary); }
.selected-uprn { font-size: .78rem; color: var(--text-light); margin-top: .2rem; opacity: .6; }
.selected-uprn i { color: var(--brand-primary); margin-right: .2rem; font-size: .7rem; }
.change-link { font-size: .85rem; margin-left: .5rem; }

.product-type-toggle {
    display: inline-flex;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1rem;
}
.toggle-btn {
    padding: .6rem 1.5rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-light);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.toggle-btn:hover { color: var(--brand-primary); }
.toggle-btn.active {
    background: var(--brand-primary);
    color: var(--white);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
/* Centre 1-2 cards by constraining their max width */
.products-grid.grid-1 { grid-template-columns: 1fr; max-width: 400px; }
.products-grid.grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 800px; }

.product-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    position: relative;
}
.product-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.product-card.featured {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px var(--brand-primary);
}
.product-ribbon {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--brand-primary);
    color: var(--white);
    font-size: .72rem;
    font-weight: 700;
    padding: .3rem .85rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .75rem;
    align-self: flex-start;
}
.product-card-header h3 { font-size: 1.2rem; color: var(--brand-secondary); margin-bottom: .25rem; }
.product-desc { color: var(--text-light); font-size: .85rem; }

.product-speeds {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    margin: .75rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.speed { display: flex; flex-direction: column; align-items: center; flex: 1; }
.speed i { color: var(--brand-primary); margin-bottom: .25rem; }
.speed-value { font-size: 1.25rem; font-weight: 800; color: var(--brand-secondary); }
.speed-label { font-size: .75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; }

.product-pricing { text-align: center; padding: 1rem 0; }
.price-main { display: flex; align-items: flex-start; justify-content: center; gap: 2px; }
.price-main .currency { font-size: 1.25rem; font-weight: 700; color: var(--brand-secondary); margin-top: 4px; }
.price-main .amount { font-size: 2.5rem; font-weight: 800; color: var(--brand-secondary); line-height: 1; }
.price-main .period { font-size: .85rem; color: var(--text-light); align-self: flex-end; margin-bottom: 4px; }
.price-vat { font-size: .8rem; color: var(--text-light); margin-top: .25rem; }
.price-setup { font-size: .85rem; color: var(--text-light); margin-top: .25rem; }
.price-setup.free { color: var(--success); font-weight: 600; }

.product-features { margin: .75rem 0; display: flex; flex-wrap: wrap; gap: .4rem .75rem; }
.product-features .feature-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--text-light);
    white-space: nowrap;
}
/* Brand colour for ALL icons except tier keys */
.product-features i,
.product-card i:not(.tier-icon-gold):not(.tier-icon-silver):not(.tier-icon-bronze),
.speed i, .speed-guaranteed i, .speed-toggle i,
.meta-tag i, .promo-badge i, .price-setup i {
    color: var(--brand-primary);
}
.product-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.meta-tag {
    font-size: .75rem;
    padding: .25rem .6rem;
    background: var(--bg);
    border-radius: 20px;
    color: var(--text-light);
}

.no-products {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 600px;
    margin: 0 auto;
}
.no-products-icon { margin-bottom: 1.25rem; }
.no-products-icon i { font-size: 3.5rem; color: var(--text-light); }
.no-products h2 { margin-bottom: .75rem; color: var(--brand-secondary); font-size: 1.3rem; }
.no-products p { color: var(--text-light); margin-bottom: 1rem; line-height: 1.6; }
.no-products-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.no-products-hint { font-size: .85rem; color: var(--text-light); }
.product-widgets { margin-top: 2rem; text-align: center; }

/* ── Checkout Page ── */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}
.order-summary-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}
.order-summary-card h3 {
    font-size: 1.15rem;
    color: var(--brand-secondary);
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--border);
}
.summary-address, .summary-product, .summary-total { margin-bottom: 1.25rem; }
.summary-address h4, .summary-product h4 {
    font-size: .85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.summary-product .product-name {
    font-weight: 700;
    color: var(--brand-secondary);
    margin-bottom: .5rem;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    padding: .35rem 0;
    font-size: .95rem;
}
.summary-line.total {
    font-weight: 700;
    font-size: 1.1rem;
    border-top: 2px solid var(--border);
    padding-top: .75rem;
    margin-top: .5rem;
    color: var(--brand-secondary);
}
.summary-line.free span:last-child { color: var(--success); font-weight: 600; }
.summary-line.promo { color: var(--success); }
.promo-line { font-size: .88rem; }
.promo-line .text-success { color: var(--success, #22c55e); font-weight: 600; }
.promo-line i { color: var(--brand-primary); margin-right: .2rem; }
.vat-note { font-size: .8rem; color: var(--text-light); margin-top: .25rem; }

/* Cart config options */
.summary-options h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: .5rem; }
.summary-option-line { display: flex; align-items: flex-start; gap: .4rem; padding: .25rem 0; font-size: .82rem; }
.option-check { color: var(--brand-primary); flex-shrink: 0; font-size: .7rem; margin-top: 2px; }
.option-detail { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.option-label { font-weight: 600; color: var(--brand-secondary); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.option-value { color: var(--text-light); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.option-price { font-size: .75rem; color: var(--brand-primary); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.bundle-config-options { padding-left: .5rem; margin-bottom: .25rem; }
.bundle-config-options .summary-option-line { padding: .15rem 0; }
.bundle-config-options .option-label { font-size: .72rem; max-width: 160px; }
.bundle-config-options .option-value { font-size: .68rem; max-width: 160px; }
.bundle-config-options .option-price { font-size: .68rem; }

/* Payment Options */
.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.payment-option input { display: none; }
.payment-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}
.payment-card i { font-size: 1.5rem; color: var(--text-light); }
.payment-card span { font-weight: 600; font-size: .95rem; }
.payment-card small { color: var(--text-light); font-size: .8rem; }
.payment-option input:checked + .payment-card {
    border-color: var(--brand-primary);
    background: rgba(0,217,167,.05);
}
.payment-option input:checked + .payment-card i { color: var(--brand-primary); }

/* Addon items */
.addon-item { margin-bottom: 1rem; }
.addon-item h4 { font-size: .95rem; margin-bottom: .5rem; color: var(--brand-secondary); }

/* ── Pre-order Page ── */
.preorder-header { text-align: center; margin-bottom: 2rem; }
.preorder-header h1 { color: var(--brand-secondary); }
.preorder-header p { color: var(--text-light); }
.preorder-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ── Success Card ── */
.success-card {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}
.success-card .fa-circle-check { font-size: 4rem; color: var(--success); margin-bottom: 1rem; }
.success-card h2 { color: var(--brand-secondary); margin-bottom: .75rem; }
.success-card p { color: var(--text-light); margin-bottom: 1.5rem; }
.success-card.large { padding: 4rem 2rem; max-width: 600px; }
.success-icon .fa-circle-check { font-size: 5rem; }
.success-message { font-size: 1.1rem; }

/* ── Error Page ── */
.page-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}
.error-card {
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.error-card h1 { font-size: 4rem; color: var(--brand-primary); margin-bottom: .5rem; }
.error-card p { color: var(--text-light); margin-bottom: 1.5rem; }

/* ── Utility ── */
.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }
.text-warning { color: var(--warning); }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .products-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 768px) {
    .site-header {
        position: sticky; top: 0; z-index: 100;
        background: var(--white);
        box-shadow: 0 1px 4px rgba(0,0,0,.08);
        padding: 0.75rem 1rem;
    }
    .brand-logo img { max-width: min(200px, 50vw); max-height: 44px; }
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary-col { order: -1; }
    .order-summary-card { position: static; max-height: none; overflow-y: visible; }
    .form-row { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: 1fr !important; max-width: 100% !important; }
    .payment-options { grid-template-columns: 1fr; }
    .hero-section h1 { font-size: 1.5rem; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { flex-direction: column; gap: .5rem; }
    .step-label { font-size: .65rem; }
    .step-connector { width: 20px; }
    .input-row { flex-direction: column; }
}

/* Checkout navigation */
.checkout-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; padding-top: 1rem; }
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; max-width: 1200px; margin: 0 auto; }

/* Review page */
.review-section { padding: 1rem 0; border-bottom: 1px solid var(--border); position: relative; }
.review-section:last-child { border-bottom: none; }
.review-section h4 { font-size: .8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .35rem; display: flex; align-items: center; gap: .35rem; }
.review-section h4 i { color: var(--brand-primary); }
.review-value { font-weight: 600; color: var(--brand-secondary); margin-bottom: .15rem; }
.review-sub { font-size: .88rem; color: var(--text-light); }
.review-price { font-size: .85rem; color: var(--text-light); font-weight: 400; margin-left: .5rem; }
.review-edit { position: absolute; top: 1rem; right: 0; font-size: .82rem; color: var(--brand-primary); text-decoration: none; font-weight: 600; }
.review-edit:hover { text-decoration: underline; }

/* Checkout card shared styles */
.checkout-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 1rem; overflow: hidden; }
.checkout-card-header { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--bg); }
.card-step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-primary); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.checkout-card-header h2 { font-size: 1.05rem; color: var(--brand-secondary); margin: 0; }
.checkout-card-body { padding: 1.5rem; }
