/* ============================================================
   TransLog v2.5 — Products, Totals, Event Editing
   Replaces public/assets/css/products.css
   ============================================================ */

/* --- Section title helper --- */
.section-title {
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
    font-size: 1rem;
    color: #0B1D3A;
    letter-spacing: 0.01em;
}

/* =============== ADMIN: PRODUCT BUILDER =============== */
.products-section {
    margin-top: 32px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}
.products-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.products-title {
    margin: 0;
    font-size: 1.1rem;
    color: #0B1D3A;
}
.products-sub {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.86rem;
}

.products-builder {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.products-empty {
    text-align: center;
    padding: 36px 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
}
.products-empty-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    opacity: 0.55;
}

.product-row {
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    border-radius: 10px;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.product-row:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    border-left-color: #2563eb;
}
.product-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.product-row-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #0B1D3A;
    font-size: 0.95rem;
}
.product-row-icon { font-size: 1.1rem; }

.product-subtotal-badge {
    font-size: 0.82rem;
    color: #475569;
    padding: 4px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-weight: 600;
    margin-left: auto;
    margin-right: 8px;
    white-space: nowrap;
}

/* Icon-only buttons */
.btn-icon {
    width: 32px; height: 32px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #475569;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}
.btn-icon:hover { background: #f1f5f9; transform: translateY(-1px); }
.btn-icon-danger {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}
.btn-icon-danger:hover {
    background: #dc2626; color: #fff; border-color: #dc2626;
}
.btn-icon-sm { width: 26px; height: 26px; font-size: 0.78rem; }

.product-row .form-group.col-sm   { max-width: 110px; }
.product-row .form-group.col-wide { flex: 2; }

/* Accessories */
.accessories-block {
    margin-top: 14px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.accessories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.accessories-label {
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.accessories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.accessory-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #94a3b8;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-left-color 0.15s;
}
.accessory-row:hover { border-left-color: #64748b; }
.accessory-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.accessory-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.accessory-row .form-group label {
    font-size: 0.78rem;
    color: #64748b;
}

/* Grand total in admin form */
.products-grand-total {
    margin-top: 20px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #0B1D3A 0%, #1e3a8a 100%);
    color: #fff;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(11, 29, 58, 0.15);
}
.grand-total-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    opacity: 0.85;
}
.grand-total-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.grand-total-chip {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    backdrop-filter: blur(8px);
}

/* =============== ADMIN: TRACKING EVENTS TABLE =============== */
.events-table tr:hover td { background: #f8fafc; }
.events-table .btn-xs { margin-right: 4px; }

.event-edit-row td {
    background: #fef3c7 !important;  /* highlight the row being edited */
    padding: 16px !important;
}
.event-edit-form {
    padding: 4px;
}
.event-edit-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.event-edit-grid .form-group { margin: 0; }
.event-edit-grid label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #78350f;
    margin-bottom: 4px;
}
.event-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px dashed #fbbf24;
}

@media (max-width: 900px) {
    .event-edit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .event-edit-grid { grid-template-columns: 1fr; }
}

/* =============== PUBLIC: TRACKING PRODUCTS =============== */
.tracking-products {
    margin-top: 32px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.tracking-products-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.tracking-products-head h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #0B1D3A;
}
.products-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 13px;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Public product card */
.product-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.product-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}
.product-card-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
}
.product-card-icon {
    width: 46px; height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    border-radius: 11px;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.product-card-body { min-width: 0; }
.product-card-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #0B1D3A;
    line-height: 1.3;
    word-break: break-word;
}
.product-card-sku {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.82rem;
}
.product-card-sku span {
    font-family: monospace, 'Space Mono', monospace;
    color: #0B1D3A;
    font-weight: 500;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 2px;
}
.product-card-numbers {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.qty-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #334155;
}
.qty-chip-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.qty-chip-value { font-weight: 600; }
.price-chip {
    padding: 6px 14px;
    background: linear-gradient(135deg, #0B1D3A 0%, #1e3a8a 100%);
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 6px rgba(11, 29, 58, 0.2);
}

/* Accessories on public page */
.product-accessories {
    border-top: 1px dashed #cbd5e1;
    background: #f8fafc;
    padding: 14px 20px 16px;
}
.product-accessories-label {
    font-size: 0.74rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.acc-label-icon { color: #94a3b8; font-weight: normal; }
.acc-count { font-weight: 500; color: #94a3b8; text-transform: none; letter-spacing: 0; }

.product-accessories ul { list-style: none; margin: 0; padding: 0; }
.product-accessories li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.9rem;
}
.product-accessories li:last-child { border-bottom: 0; }
.acc-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
.acc-name { font-weight: 500; color: #0B1D3A; }
.acc-sku {
    font-size: 0.78rem;
    color: #64748b;
    font-family: monospace, 'Space Mono', monospace;
}
.acc-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    flex-shrink: 0;
}
.acc-qty {
    color: #475569;
    padding: 3px 9px;
    background: #e2e8f0;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.78rem;
}
.acc-price { color: #0B1D3A; font-weight: 600; }

/* Per-product subtotal row on public page */
.product-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    gap: 10px;
    flex-wrap: wrap;
}
.product-subtotal-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.product-subtotal-amounts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.product-subtotal-chip {
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    font-weight: 600;
    color: #0B1D3A;
    font-size: 0.88rem;
}

/* Grand total on public page */
.tracking-grand-total {
    margin-top: 18px;
    padding: 20px 28px;
    background: linear-gradient(135deg, #0B1D3A 0%, #1e3a8a 100%);
    color: #fff;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(11, 29, 58, 0.18);
}
.tracking-grand-total .grand-total-label {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}
.tracking-grand-total .grand-total-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tracking-grand-total .grand-total-chip {
    display: inline-block;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 24px;
    font-size: 1.15rem;
    font-weight: 700;
}

/* Mobile */
@media (max-width: 640px) {
    .product-card-head { grid-template-columns: auto 1fr; }
    .product-card-numbers {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }
    .product-accessories li {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .acc-right { align-self: flex-end; }
    .tracking-grand-total { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   v2.6 — Testimonials section + admin
   ============================================================ */

/* Section eyebrow text */
.section-eyebrow {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #3b82f6;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Public section background */
.testimonials-section {
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
    padding: 64px 0 72px;
    overflow: hidden;
}
.testimonials-section .section-header { text-align: center; }
.testimonials-section .section-header h2 {
    font-size: 2.4rem;
    color: #0B1D3A;
    margin: 0;
    font-weight: 700;
}
.testimonials-section .section-header p {
    margin-top: 20px;
    color: #64748b;
    font-size: 1rem;
}
.testimonials-section .accent-line {
    display: inline-block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 2px;
    margin-top: 14px;
}

/* Marquee container — full width, masks edges */
.testimonials-marquee {
    position: relative;
    margin-top: 48px;
    overflow: hidden;
    padding: 12px 0 24px;
    /* Fade edges so cards don't pop abruptly */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
}

/* Animated track — holds 2x the cards for seamless loop */
.tm-track {
    display: flex;
    gap: 24px;
    width: max-content;
    animation: tm-scroll var(--tm-speed, 40s) linear infinite;
    will-change: transform;
}
.testimonials-marquee:hover .tm-track {
    animation-play-state: paused;   /* pause on hover */
}
@keyframes tm-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }   /* move half (= one set, since we render twice) */
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .tm-track { animation: none; }
    .testimonials-marquee {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Individual card */
.tm-card {
    flex: 0 0 360px;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 22px 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.tm-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.tm-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    position: relative;
}
.tm-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.tm-who { flex: 1; min-width: 0; }
.tm-name {
    font-weight: 700;
    color: #0B1D3A;
    font-size: 0.98rem;
    line-height: 1.2;
}
.tm-country {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tm-flag {
    display: inline-block;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
    vertical-align: middle;
}
.tm-quote-mark {
    position: absolute;
    right: 0;
    top: -6px;
    font-family: Georgia, serif;
    font-size: 3.4rem;
    line-height: 1;
    color: #dbeafe;
    font-weight: 700;
    pointer-events: none;
}

.tm-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 12px;
    font-size: 1.05rem;
}
.tm-stars .star-on  { color: #f59e0b; }
.tm-stars .star-off { color: #e2e8f0; }

.tm-quote {
    margin: 0;
    color: #475569;
    font-style: italic;
    font-size: 0.92rem;
    line-height: 1.55;
}
.tm-quote::before { content: '"'; }
.tm-quote::after  { content: '"'; }

/* Mobile */
@media (max-width: 640px) {
    .testimonials-section { padding: 48px 0 56px; }
    .testimonials-section .section-header h2 { font-size: 1.8rem; }
    .tm-card { flex-basis: 280px; padding: 18px; }
    .tm-quote-mark { font-size: 2.6rem; }
}

/* ============================================================
   ADMIN — testimonials list + editor
   ============================================================ */
.avatar-thumb {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}
.country-code-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    letter-spacing: 0.05em;
}
.star-rating-inline {
    color: #f59e0b;
    letter-spacing: 0.05em;
    font-size: 1rem;
}

.lang-code-chip {
    display: inline-block;
    padding: 2px 9px;
    background: #3b82f6;
    color: #fff;
    border-radius: 11px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-right: 8px;
}

.testimonial-translations .form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.lang-block {
    margin-bottom: 18px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.lang-block-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #475569;
    font-weight: 600;
    font-size: 0.95rem;
}
