/* =========================================================================
   ElectroPro design tokens (spec section 8.1).
   These are the brand values the Tailwind migration (Phase 1 task 15) will
   absorb. For now we expose them as CSS custom properties so Razor Pages
   markup can use them with Bootstrap utilities.
   ========================================================================= */

:root {
    --ep-primary: #1A56DB;
    --ep-primary-dark: #1740a8;
    --ep-secondary: #6366F1;
    --ep-success: #166534;
    --ep-warning: #92400E;
    --ep-danger: #BE123C;
    --ep-ink: #0F172A;
    --ep-ink-muted: #475569;
    --ep-paper: #F8FAFC;
    --ep-line: #E2E8F0;
    --ep-radius: 0.5rem;
    --ep-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ep-shadow-hover: 0 4px 10px 0 rgba(0, 0, 0, 0.08);
}

html {
    font-size: 15px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html, body {
    background: var(--ep-paper);
    color: var(--ep-ink);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100%;
}

body {
    margin-bottom: 0;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(26, 86, 219, 0.35);
}

/* ===== Buttons ===== */
.btn-primary, .btn-primary:focus {
    background-color: var(--ep-primary);
    border-color: var(--ep-primary);
}
.btn-primary:hover {
    background-color: var(--ep-primary-dark);
    border-color: var(--ep-primary-dark);
}

/* ===== Hero ===== */
.ep-hero {
    background: linear-gradient(135deg, var(--ep-primary) 0%, var(--ep-secondary) 100%);
    color: #fff;
    border-radius: var(--ep-radius);
    padding: 4rem 2rem;
    box-shadow: var(--ep-shadow);
}
.ep-hero h1 {
    font-weight: 700;
    font-size: 2.4rem;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}
.ep-hero p {
    opacity: 0.92;
    font-size: 1.1rem;
    max-width: 36rem;
}
.ep-hero .btn-light {
    background: #fff;
    color: var(--ep-primary);
    border: none;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--ep-radius);
}

/* ===== Section headers ===== */
.ep-section {
    margin: 3rem 0;
}
.ep-section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.25rem;
}
.ep-section-title h2 {
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0;
}
.ep-section-title a {
    color: var(--ep-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

/* ===== Cards ===== */
.ep-card {
    background: #fff;
    border: 1px solid var(--ep-line);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow);
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.ep-card:hover {
    box-shadow: var(--ep-shadow-hover);
    transform: translateY(-2px);
}
.ep-card a {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.ep-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f1f5f9;
}
.ep-card-body {
    padding: 0.85rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.ep-card-body .ep-brand {
    font-size: 0.78rem;
    color: var(--ep-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.ep-card-body .ep-name {
    font-weight: 600;
    color: var(--ep-ink);
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ep-price-row {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.ep-price {
    font-weight: 700;
    color: var(--ep-ink);
    font-size: 1.05rem;
}
.ep-compare {
    color: var(--ep-ink-muted);
    text-decoration: line-through;
    font-size: 0.88rem;
}
.ep-save-badge {
    background: var(--ep-danger);
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ===== Category tile ===== */
.ep-category-tile {
    background: #fff;
    border: 1px solid var(--ep-line);
    border-radius: var(--ep-radius);
    padding: 1.25rem 1rem;
    text-align: center;
    display: block;
    color: var(--ep-ink);
    text-decoration: none;
    box-shadow: var(--ep-shadow);
    transition: box-shadow .15s ease, transform .15s ease;
    height: 100%;
}
.ep-category-tile:hover {
    box-shadow: var(--ep-shadow-hover);
    transform: translateY(-2px);
    color: var(--ep-primary);
}
.ep-category-tile-image {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #eef2ff;
    margin-bottom: 0.5rem;
}
.ep-category-tile-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.ep-category-tile-meta {
    color: var(--ep-ink-muted);
    font-size: 0.8rem;
}

/* ===== Trust strip ===== */
.ep-trust {
    background: #fff;
    border: 1px solid var(--ep-line);
    border-radius: var(--ep-radius);
    padding: 1rem;
    text-align: center;
    height: 100%;
}
.ep-trust h6 {
    margin: 0.5rem 0 0.25rem;
    font-weight: 600;
}
.ep-trust small {
    color: var(--ep-ink-muted);
}
.ep-trust .ep-trust-icon {
    font-size: 1.5rem;
}

/* ===== PDP - product detail page ===== */
.ep-pdp-name {
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.2;
}
.ep-pdp-price-row {
    padding: 0.75rem 0;
    border-top: 1px solid var(--ep-line);
    border-bottom: 1px solid var(--ep-line);
}
.ep-pdp-price {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--ep-ink);
}

.ep-pdp-gallery input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ep-pdp-main {
    background: #fff;
    border: 1px solid var(--ep-line);
    border-radius: var(--ep-radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
}
.ep-pdp-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}
.ep-pdp-main .ep-pdp-main-img:first-of-type { display: block; }

/* Pure-CSS thumbnail switching: when a thumb's <input> is checked,
   hide everyone else and show its matching image. Supports up to 8
   images on a PDP, which is far above the realistic catalog norm. */
.ep-pdp-gallery input[type=radio]:checked ~ .ep-pdp-main .ep-pdp-main-img { display: none; }
.ep-pdp-gallery input[type=radio]:nth-of-type(1):checked ~ .ep-pdp-main .ep-pdp-main-img:nth-of-type(1),
.ep-pdp-gallery input[type=radio]:nth-of-type(2):checked ~ .ep-pdp-main .ep-pdp-main-img:nth-of-type(2),
.ep-pdp-gallery input[type=radio]:nth-of-type(3):checked ~ .ep-pdp-main .ep-pdp-main-img:nth-of-type(3),
.ep-pdp-gallery input[type=radio]:nth-of-type(4):checked ~ .ep-pdp-main .ep-pdp-main-img:nth-of-type(4),
.ep-pdp-gallery input[type=radio]:nth-of-type(5):checked ~ .ep-pdp-main .ep-pdp-main-img:nth-of-type(5),
.ep-pdp-gallery input[type=radio]:nth-of-type(6):checked ~ .ep-pdp-main .ep-pdp-main-img:nth-of-type(6),
.ep-pdp-gallery input[type=radio]:nth-of-type(7):checked ~ .ep-pdp-main .ep-pdp-main-img:nth-of-type(7),
.ep-pdp-gallery input[type=radio]:nth-of-type(8):checked ~ .ep-pdp-main .ep-pdp-main-img:nth-of-type(8) { display: block; }

.ep-pdp-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}
.ep-pdp-thumb {
    flex: 0 0 80px;
    height: 80px;
    border: 2px solid var(--ep-line);
    border-radius: var(--ep-radius);
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    padding: 0;
}
.ep-pdp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ep-pdp-thumb:hover {
    border-color: var(--ep-primary);
}
.ep-pdp-specs th {
    font-weight: 500;
    color: var(--ep-ink-muted);
}

/* ===== Footer ===== */
.ep-footer {
    background: #fff;
    border-top: 1px solid var(--ep-line);
    color: var(--ep-ink-muted);
    padding: 1.5rem 0;
    margin-top: 4rem;
    font-size: 0.9rem;
}
.ep-footer a { color: var(--ep-primary); text-decoration: none; }
