/* ═══════════════════════════════════════════════════════════════
   Awning Customizer v2 – Modern Frontend Styles
   Font: Outfit (Google Fonts)
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
.ac-wrap {
    --f:          'Outfit', sans-serif;
    --navy:       #0b1f3a;
    --blue:       #1d4ed8;
    --blue-light: #3b82f6;
    --blue-soft:  #eff6ff;
    --gold:       #f59e0b;
    --green:      #10b981;
    --red:        #ef4444;
    --text:       #0f172a;
    --muted:      #64748b;
    --border:     #e2e8f0;
    --bg:         #f8fafc;
    --card:       #ffffff;
    --r-sm:       8px;
    --r:          14px;
    --r-lg:       22px;
    --shadow-sm:  0 1px 4px rgba(0,0,0,.07);
    --shadow:     0 4px 20px rgba(0,0,0,.09);
    --shadow-lg:  0 12px 48px rgba(0,0,0,.14);
    --trans:      .22s cubic-bezier(.4,0,.2,1);

    font-family: var(--f);
    color: var(--text);
    width: 100%;
    padding: 0 0 60px;
    box-sizing: border-box;
}

*, *::before, *::after { box-sizing: border-box; }

/* ── Stepper ────────────────────────────────────────────────── */
.ac-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 36px 40px 48px;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: auto;
}

.ac-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ac-step-bubble {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2.5px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans);
    position: relative;
}

.ac-step-num {
    font-family: var(--f);
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
    transition: all var(--trans);
}

.ac-step-check {
    width: 18px;
    height: 18px;
    position: absolute;
    opacity: 0;
    transition: opacity var(--trans);
    color: #fff;
    stroke-width: 2.5;
}

.ac-step-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--muted);
    transition: color var(--trans);
    white-space: nowrap;
}

/* Active */
.ac-step.is-active .ac-step-bubble {
    border-color: var(--blue);
    background: var(--blue);
    box-shadow: 0 0 0 5px rgba(29,78,216,.15);
}
.ac-step.is-active .ac-step-num  { color: #fff; }
.ac-step.is-active .ac-step-label{ color: var(--blue); }

/* Complete */
.ac-step.is-done .ac-step-bubble {
    border-color: var(--green);
    background: var(--green);
}
.ac-step.is-done .ac-step-num    { opacity: 0; }
.ac-step.is-done .ac-step-check  { opacity: 1; }
.ac-step.is-done .ac-step-label  { color: var(--green); }

/* Connector lines */
.ac-step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin-bottom: 28px;
    min-width: 32px;
    max-width: 80px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.ac-step-line-fill {
    position: absolute;
    inset: 0;
    background: var(--green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s cubic-bezier(.4,0,.2,1);
}

.ac-step-line.is-done .ac-step-line-fill { transform: scaleX(1); }

/* ── Panels ─────────────────────────────────────────────────── */
.ac-panel {
    display: none;
    animation: ac-slide-in .35s cubic-bezier(.4,0,.2,1) both;
}

.ac-panel.is-active { display: block; }

@keyframes ac-slide-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ac-panel--split {
    display: none;
    flex-direction: column;
    padding: 0 40px;
    box-sizing: border-box;
    gap: 32px;
}

.ac-panel--split.is-active {
    display: flex;
}

@media (min-width: 900px) {
    .ac-panel--split {
        display: none;
        flex-direction: row;
        align-items: flex-start;
        gap: 40px;
        flex-wrap: wrap;
    }
    .ac-panel--split.is-active { display: flex; }
    .ac-split-left  { width: 320px; flex-shrink: 0; }
    .ac-split-right { flex: 1; }
    .ac-panel-footer{ width: 100%; }
}

/* ── Panel headers ──────────────────────────────────────────── */
.ac-panel-hero {
    text-align: center;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 40px;
    margin-bottom: 36px;
}

.ac-panel-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--blue-light);
    margin: 0 0 10px;
}

.ac-panel-title {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 10px;
    letter-spacing: -.5px;
    line-height: 1.15;
}

.ac-panel-sub {
    font-size: 16px;
    color: var(--muted);
    margin: 0;
    font-weight: 400;
}

/* Same headers inside split panels */
.ac-split-left .ac-panel-eyebrow,
.ac-split-left .ac-panel-title,
.ac-split-left .ac-panel-sub { text-align: left; }

.ac-split-left .ac-panel-title { font-size: 24px; }
.ac-split-left .ac-panel-eyebrow { margin-bottom: 6px; }
.ac-split-left .ac-panel-sub { margin-bottom: 20px; }

/* ── Product Grid ───────────────────────────────────────────── */
.ac-product-grid {
    display: grid;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.ac-product-card {
    background: var(--card);
    border-radius: var(--r-lg);
    overflow: hidden;
    cursor: pointer;
    border: 2.5px solid var(--border);
    transition: all var(--trans);
    box-shadow: var(--shadow-sm);
    position: relative;
    outline: none;
}

.ac-product-card:hover {
    border-color: var(--blue);
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.ac-product-card.is-selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(29,78,216,.18), var(--shadow-lg);
}

.ac-product-card.is-selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f);
    line-height: 1;
    padding-top: 1px;
}

.ac-product-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #e8ecf0, #f7f9fc);
}

.ac-product-no-img {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e8ecf0, #f7f9fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
}

.ac-product-body {
    padding: 18px 20px 20px;
    background: var(--card);
}

.ac-product-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 10px;
}

.ac-product-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    padding: 7px 16px;
    border: 2px solid var(--blue-soft);
    border-radius: 30px;
    background: var(--blue-soft);
    transition: all var(--trans);
}

.ac-product-card:hover .ac-product-cta,
.ac-product-card.is-selected .ac-product-cta {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* ── Color Grid ─────────────────────────────────────────────── */
.ac-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 2px;
}

.ac-color-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--trans);
    outline: none;
}

.ac-color-card:hover {
    border-color: var(--blue-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.ac-color-card.is-selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29,78,216,.2);
}

.ac-color-thumb {
    width: 100%;
    height: 72px;
    object-fit: cover;
    display: block;
}

.ac-color-no-thumb {
    width: 100%;
    height: 72px;
    display: block;
}

.ac-color-footer {
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
}

.ac-color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,.1);
    flex-shrink: 0;
}

.ac-color-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--f);
}

/* ── Background Grid ────────────────────────────────────────── */
.ac-bg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
}

.ac-bg-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--trans);
    outline: none;
    position: relative;
}

.ac-bg-card:hover {
    border-color: var(--blue-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.ac-bg-card.is-selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29,78,216,.2);
}

.ac-bg-card.is-selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f);
}

.ac-bg-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.ac-bg-none-thumb {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background:
        repeating-conic-gradient(#d1d5db 0% 25%, #f3f4f6 0% 50%)
        0 0 / 20px 20px;
}

.ac-bg-footer {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--f);
}

/* ── Preview / Canvas ───────────────────────────────────────── */
.ac-preview-card {
    background: var(--card);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: sticky;
    top: 20px;
}

.ac-preview-label {
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    font-family: var(--f);
}

.ac-canvas-wrap {
    position: relative;
    background-color: var(--bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    aspect-ratio: 3/2;
    transition: background-image .3s ease;
    isolation: isolate;
}

.ac-canvas-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
}

/* Preview canvases: white pixels become transparent revealing BG behind */
#ac-canvas-2,
#ac-canvas-3,
#ac-canvas-4 {
    mix-blend-mode: multiply;
}

.ac-canvas-wrap--summary {
    border-radius: 0;
    overflow: hidden;
    border: none;
    aspect-ratio: unset;
}

.ac-canvas-wrap--summary canvas {
    width: 100%;
    height: auto;
    display: block;
}

.ac-canvas-spinner {
    position: absolute;
    inset: 0;
    background: rgba(248,250,252,.8);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--trans);
    pointer-events: none;
}

.ac-canvas-spinner.is-hidden { opacity: 0; }

.ac-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: ac-spin .7s linear infinite;
}

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

.ac-preview-tags {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    min-height: 46px;
}

.ac-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--f);
}

.ac-tag-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.1);
}

/* ── Panel Footer / Nav ─────────────────────────────────────── */
.ac-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 40px 0;
    margin: 28px auto 0;
    border-top: 1px solid var(--border);
    gap: 12px;
    max-width: 1400px;
    box-sizing: border-box;
    width: 100%;
}

.ac-panel-footer--summary {
    margin-top: 0;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 28px;
    padding-bottom: 28px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 30px;
    border-radius: 10px;
    font-family: var(--f);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform .18s cubic-bezier(.4,0,.2,1),
                box-shadow .18s cubic-bezier(.4,0,.2,1),
                background .18s ease,
                opacity .18s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: .01em;
    position: relative;
    overflow: hidden;
}

/* Ripple shimmer on hover */
.ac-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .45s ease;
}
.ac-btn:hover::after { transform: translateX(100%); }

.ac-btn--primary {
    background: #0f172a;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.22), 0 1px 4px rgba(0,0,0,.12);
}
.ac-btn--primary:hover:not(:disabled) {
    background: #1e293b;
    box-shadow: 0 8px 28px rgba(0,0,0,.30), 0 2px 8px rgba(0,0,0,.14);
    transform: translateY(-2px) scale(1.01);
}
.ac-btn--primary:active:not(:disabled) {
    transform: translateY(0) scale(.99);
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.ac-btn--primary:disabled {
    background: #94a3b8;
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
    opacity: .6;
}

.ac-btn--ghost {
    background: transparent;
    color: #475569;
    border: 1.5px solid #cbd5e1;
}
.ac-btn--ghost:hover {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.ac-btn--ghost:active { transform: none; }

.ac-btn--outline {
    background: transparent;
    color: #0f172a;
    border: 2px solid #0f172a;
}
.ac-btn--outline:hover {
    background: #0f172a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.20);
}
.ac-btn--outline:active { transform: none; }

.ac-btn--full { width: 100%; }

/* ── Summary Layout ─────────────────────────────────────────── */
.ac-summary-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.ac-summary-canvas-col {
    width: 100%;
    padding: 0;
}

.ac-summary-detail-col {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    align-items: start;
    padding: 32px 40px;
    box-sizing: border-box;
}

/* Config card spans both rows on the left */
.ac-summary-detail-col .ac-detail-card {
    grid-column: 1;
    grid-row: 1 / 3;
    margin-bottom: 0;
}

/* Email card top-right */
.ac-summary-detail-col .ac-email-card {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 0;
}

/* Download button bottom-right */
#ac-dl-btn {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
}

@media (max-width: 700px) {
    .ac-summary-detail-col {
        grid-template-columns: 1fr;
    }
    .ac-summary-detail-col .ac-detail-card { grid-row: auto; }
    #ac-dl-btn { grid-column: 1; grid-row: auto; }
}

.ac-detail-card,
.ac-email-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.ac-detail-card h3,
.ac-email-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 18px;
    font-family: var(--f);
}

.ac-email-card p {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 16px;
}

.ac-detail-item {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.ac-detail-item:last-child { border-bottom: none; padding-bottom: 0; }

.ac-detail-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 5px;
    font-family: var(--f);
}

.ac-detail-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    font-family: var(--f);
}

.ac-detail-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-detail-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,.1);
    flex-shrink: 0;
    display: inline-block;
}

/* ── Input ──────────────────────────────────────────────────── */
.ac-input-group {
    margin-bottom: 14px;
}

.ac-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin-bottom: 6px;
    font-family: var(--f);
}

.ac-input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-family: var(--f);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--trans), box-shadow var(--trans);
    outline: none;
}

.ac-input-group input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(29,78,216,.1);
    background: #fff;
}

/* ── Message ────────────────────────────────────────────────── */
.ac-msg {
    margin-top: 12px;
    padding: 11px 15px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--f);
}
.ac-msg.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.ac-msg.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.ac-msg.loading { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Skeleton loaders ───────────────────────────────────────── */
.ac-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    width: 100%;
}

.ac-skeleton {
    height: 280px;
    border-radius: var(--r-lg);
    background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
    background-size: 200% 100%;
    animation: ac-shimmer 1.4s infinite;
}

@keyframes ac-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── required ───────────────────────────────────────────────── */
.required { color: var(--red); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ac-stepper { gap: 0; padding: 24px 0 36px; }
    .ac-step-label { font-size: 9px; }
    .ac-step-bubble { width: 36px; height: 36px; }
    .ac-step-line { min-width: 16px; max-width: 40px; }
    .ac-product-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .ac-color-grid, .ac-bg-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .ac-btn { padding: 11px 18px; font-size: 14px; }
    .ac-panel-title { font-size: 22px; }
}
