/* =============================================================
   TacticalSource — main.css
   Supplemental styles beyond Tailwind utilities.
   Design palette: olive / graphite / sand / cream
   ============================================================= */

/* ── CSS custom properties ─────────────────────────────────── */
:root {
    --color-olive-500:    #3D4A2E;
    --color-olive-600:    #2A3320;
    --color-graphite-700: #1E2224;
    --color-graphite-800: #141618;
    --color-graphite-900: #0A0C0D;
    --color-sand-400:     #C09B6E;
    --color-sand-500:     #B8956A;
    --color-cream-100:    #F7F6F2;
    --color-cream-200:    #EDECEA;
    --color-cream-300:    #E0DED8;

    --radius-sm:  0.125rem;
    --radius-md:  0.25rem;
    --transition: 0.18s ease;
}

/* ── Utilities ──────────────────────────────────────────────── */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* ── Button convenience classes ─────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: var(--color-olive-500);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--color-olive-600);
}
.btn-primary:focus-visible {
    outline: 2px solid var(--color-sand-500);
    outline-offset: 2px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: transparent;
    color: var(--color-olive-500);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1.5px solid var(--color-olive-500);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
    background-color: var(--color-olive-500);
    color: #fff;
}
.btn-secondary:focus-visible {
    outline: 2px solid var(--color-sand-500);
    outline-offset: 2px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: transparent;
    color: var(--color-graphite-700);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--color-cream-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
    background-color: var(--color-cream-200);
    border-color: var(--color-cream-300);
}
.btn-ghost:focus-visible {
    outline: 2px solid var(--color-sand-500);
    outline-offset: 2px;
}

/* ── Spec table ──────────────────────────────────────────────── */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--color-graphite-700);
}
.spec-table caption {
    text-align: start;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-graphite-700);
    margin-bottom: 0.5rem;
    padding: 0 0 0.375rem 0;
    border-bottom: 1px solid var(--color-cream-300);
}
.spec-table th,
.spec-table td {
    padding: 0.55rem 0.875rem;
    border: 1px solid var(--color-cream-300);
    vertical-align: top;
    text-align: start;
}
.spec-table th {
    background-color: var(--color-cream-200);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-graphite-900);
    white-space: nowrap;
    width: 38%;
}
.spec-table td {
    background-color: #fff;
}
.spec-table tr:nth-child(even) td {
    background-color: var(--color-cream-100);
}

/* ── RFQ progress step indicator ────────────────────────────── */
.rfq-progress {
    display: flex;
    align-items: flex-start;
    gap: 0;
    counter-reset: rfq-step;
    margin-bottom: 2rem;
}
.rfq-progress__step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    counter-increment: rfq-step;
    text-align: center;
}
/* connector line between steps */
.rfq-progress__step + .rfq-progress__step::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 50%;
    left: -50%;
    height: 2px;
    background-color: var(--color-cream-300);
    z-index: 0;
}
.rfq-progress__step.done + .rfq-progress__step::before,
.rfq-progress__step.active + .rfq-progress__step::before {
    background-color: var(--color-olive-500);
}
.rfq-progress__dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--color-cream-300);
    border: 2px solid var(--color-cream-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    position: relative;
    z-index: 1;
    transition: background-color var(--transition), border-color var(--transition);
}
.rfq-progress__step.done .rfq-progress__dot {
    background-color: var(--color-olive-500);
    border-color: var(--color-olive-500);
    color: #fff;
}
.rfq-progress__step.active .rfq-progress__dot {
    background-color: #fff;
    border-color: var(--color-olive-500);
    color: var(--color-olive-500);
    box-shadow: 0 0 0 3px rgba(61, 74, 46, 0.12);
}
.rfq-progress__label {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-graphite-700);
    max-width: 6rem;
    line-height: 1.3;
}
.rfq-progress__step.active .rfq-progress__label {
    color: var(--color-olive-500);
    font-weight: 600;
}

/* ── Product card image wrapper (catalog grid) ──────────────── */
.product-img-wrap {
    position: relative;
    overflow: hidden;
    background-color: var(--color-cream-200);
    flex-shrink: 0;
}
.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.product-img-wrap:hover img {
    transform: scale(1.04);
}

/* ── Product gallery ────────────────────────────────────────── */
.product-gallery {
    display: grid;
    grid-template-rows: auto auto;
    gap: 0.625rem;
}
.product-gallery__main {
    position: relative;
    overflow: hidden;
    background-color: var(--color-cream-200);
    aspect-ratio: 4 / 3;
}
.product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.product-gallery__main:hover img {
    transform: scale(1.04);
}
.product-gallery__thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.product-gallery__thumb {
    width: 5rem;
    height: 4rem;
    overflow: hidden;
    background-color: var(--color-cream-200);
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--transition);
    flex-shrink: 0;
}
.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition);
}
.product-gallery__thumb:hover img {
    opacity: 0.85;
}
.product-gallery__thumb.active {
    border-color: var(--color-olive-500);
}

/* ── Admin table ─────────────────────────────────────────────── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background-color: #fff;
}
.admin-table thead th {
    padding: 0.6rem 1rem;
    background-color: var(--color-cream-200);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-graphite-700);
    border-bottom: 1px solid var(--color-cream-300);
    text-align: start;
    white-space: nowrap;
}
.admin-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--color-cream-200);
    color: var(--color-graphite-700);
    vertical-align: middle;
}
.admin-table tbody tr:hover td {
    background-color: var(--color-cream-100);
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}
/* Responsive wrapper */
.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-cream-300);
    border-radius: var(--radius-sm);
}

/* ── Mobile menu slide animation ────────────────────────────── */
.mobile-menu-panel {
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.22s ease;
}
.mobile-menu-panel.hidden {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
}
.mobile-menu-panel:not(.hidden) {
    max-height: 32rem;
    opacity: 1;
}

/* ── Sticky header shadow boost on scroll ───────────────────── */
#site-header.scrolled {
    box-shadow: 0 2px 12px rgba(10, 12, 13, 0.1);
}

/* ── Scrollbar (webkit) ──────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--color-cream-200); }
::-webkit-scrollbar-thumb  { background: var(--color-cream-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-sand-500); }

/* ── Tab panel helper ────────────────────────────────────────── */
.tab-panel          { display: none; }
.tab-panel.active   { display: block; }

/* ── File drop zone ─────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--color-cream-300);
    background-color: var(--color-cream-100);
    transition: border-color var(--transition), background-color var(--transition);
    cursor: pointer;
}
.drop-zone.drag-over,
.drop-zone:hover {
    border-color: var(--color-olive-500);
    background-color: #f2f3ee;
}
.drop-zone.has-files {
    border-color: var(--color-olive-500);
    background-color: #eef0eb;
}

/* ── Toast notifications ─────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    inset-inline-end: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 18rem;
    max-width: 24rem;
    padding: 0.85rem 1rem;
    background-color: var(--color-graphite-800);
    color: var(--color-cream-100);
    font-size: 0.85rem;
    border-inline-start: 3px solid var(--color-sand-500);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    pointer-events: all;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.toast-success { border-inline-start-color: #4ade80; }
.toast.toast-error   { border-inline-start-color: #f87171; }
.toast.toast-info    { border-inline-start-color: var(--color-sand-500); }
.toast__icon {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.05rem;
}

/* ── RTL overrides ───────────────────────────────────────────── */

/* Flip breadcrumb / chevron separator arrows in RTL */
[dir="rtl"] .bc-sep {
    transform: scaleX(-1);
}

/* Product info panel — quote line on the correct side */
[dir="rtl"] .short-desc-border {
    border-left: none;
    border-right: 2px solid var(--color-sand-500);
    padding-left: 0;
    padding-right: 1rem;
}

/* Lightbox close button — stay in the correct corner */
[dir="rtl"] #lightbox-close {
    right: auto;
    left: 1rem;
}

/* ── Print styles ────────────────────────────────────────────── */
@media print {
    #site-header,
    #mobile-menu,
    footer,
    #toast-container,
    .btn-primary,
    .btn-secondary,
    .btn-ghost {
        display: none !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
    }
    .admin-table,
    .spec-table {
        border: 1px solid #ccc;
    }
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.75em;
        color: #555;
    }
}