/* =========================================================
   UFS Communication Catalog + Product Details CSS
   Light theme / Mobile responsive / SEO-friendly layout
========================================================= */

:root {
    --primary: #fc3237;
    --primary-dark: #d92228;
    --secondary: #678a56;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --light: #f7f8fb;
    --white: #ffffff;
    --soft-red: #fff0f1;
    --soft-green: #f0f8ed;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--light);
    color: var(--text);
    padding-bottom: 84px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select {
    font: inherit;
}

.ufsc-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    padding: 12px max(16px, calc((100vw - 1200px) / 2));
    display: grid;
    grid-template-columns: auto minmax(240px, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--white);
    font-weight: 950;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 10px 22px rgba(252,50,55,.18);
}

.brand strong {
    display: block;
    line-height: 1;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.top-search {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 6px;
    display: flex;
    gap: 8px;
}

.top-search input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 12px;
    background: transparent;
}

.top-search button {
    border: 0;
    background: var(--primary);
    color: var(--white);
    border-radius: 13px;
    padding: 11px 16px;
    font-weight: 900;
    cursor: pointer;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.top-nav a {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
}

.ufsc-page {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 42px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    margin: 8px 0 18px;
}

.breadcrumb a {
    color: var(--primary);
    font-weight: 800;
}

.listing-hero {
    border-radius: 30px;
    padding: clamp(24px, 5vw, 46px);
    background:
        radial-gradient(circle at top right, rgba(252,50,55,.14), transparent 36%),
        radial-gradient(circle at bottom left, rgba(103,138,86,.13), transparent 36%),
        var(--white);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    color: var(--primary);
    background: var(--soft-red);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.listing-hero h1,
.product-summary h1 {
    margin: 12px 0;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.02;
    letter-spacing: -.05em;
}

.listing-hero p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    max-width: 720px;
}

.hero-count {
    width: 150px;
    height: 150px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    display: grid;
    place-items: center;
    text-align: center;
    flex: 0 0 auto;
}

.hero-count strong {
    display: block;
    font-size: 42px;
    line-height: 1;
}

.hero-count span {
    display: block;
    font-weight: 800;
    margin-top: 6px;
}

.brand-logo-large {
    width: 150px;
    height: 150px;
    object-fit: contain;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 18px;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.filters {
    position: sticky;
    top: 92px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(15,23,42,.05);
}

.filters h2 {
    margin: 0 0 16px;
}

.filters label {
    display: grid;
    gap: 7px;
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 14px;
}

.filters input,
.filters select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    outline: none;
    background: var(--light);
}

.listing-content {
    min-width: 0;
}

.listing-content.full-width {
    width: 100%;
}

.listing-bar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: var(--muted);
    font-weight: 800;
}

.listing-bar p {
    margin: 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 16px;
}

.ufsc-product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15,23,42,.05);
    transition: 180ms ease;
}

.ufsc-product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.ufsc-product-img {
    display: block;
    aspect-ratio: 1 / .86;
    background: #f9fafb;
    padding: 16px;
}

.ufsc-product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ufsc-product-body {
    padding: 14px;
}

.ufsc-product-title {
    min-height: 44px;
    font-weight: 950;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.ufsc-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    margin: 10px 0;
    color: var(--muted);
    font-size: 12px;
}

.stock-in,
.stock-low,
.stock-pre,
.stock-out {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 950;
}

.stock-in {
    background: var(--soft-green);
    color: var(--secondary);
}

.stock-low {
    background: #fff7ed;
    color: #c2410c;
}

.stock-pre {
    background: #eff6ff;
    color: #2563eb;
}

.stock-out {
    background: #f3f4f6;
    color: #6b7280;
}

.ufsc-product-price {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0 14px;
}

.price-now {
    font-size: 20px;
    font-weight: 950;
}

.price-old {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 13px;
}

.ufsc-card-actions {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 8px;
}

.btn-primary,
.btn-light,
.btn-icon {
    min-height: 44px;
    border-radius: 14px;
    border: 0;
    font-weight: 950;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 12px 28px rgba(252,50,55,.18);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-light {
    background: var(--soft-red);
    color: var(--primary);
    border: 1px solid rgba(252,50,55,.18);
}

.btn-icon {
    background: var(--soft-red);
    color: var(--primary);
    font-size: 22px;
}

.full {
    width: 100%;
    margin-top: 8px;
}

.empty-state {
    grid-column: 1 / -1;
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: 22px;
    padding: 24px;
    color: var(--muted);
}

.empty-state h2,
.empty-state h3 {
    color: var(--text);
    margin-top: 0;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.pagination a {
    min-width: 42px;
    min-height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--white);
    font-weight: 900;
}

.pagination a.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Product details */

.product-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 22px;
    align-items: start;
}

.gallery-card,
.product-summary,
.info-panel,
.section-block {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 12px 28px rgba(15,23,42,.05);
}

.gallery-card {
    padding: 18px;
    position: sticky;
    top: 92px;
}

.main-product-image {
    background: #f9fafb;
    border-radius: 22px;
    padding: 18px;
    aspect-ratio: 1 / .9;
    display: grid;
    place-items: center;
}

.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumb-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-top: 14px;
    padding-bottom: 4px;
}

.thumb-btn {
    width: 78px;
    height: 78px;
    border-radius: 16px;
    border: 2px solid transparent;
    background: #f9fafb;
    padding: 6px;
    cursor: pointer;
    flex: 0 0 auto;
}

.thumb-btn.active {
    border-color: var(--primary);
}

.thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-summary {
    padding: clamp(22px, 4vw, 34px);
}

.summary-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--muted);
    font-weight: 800;
}

.detail-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.detail-price-now {
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 950;
}

.detail-price-old {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 18px;
}

.discount-chip {
    background: var(--soft-green);
    color: var(--secondary);
    border-radius: 999px;
    padding: 7px 10px;
    font-weight: 950;
    font-size: 12px;
}

.short-desc {
    color: var(--muted);
    line-height: 1.8;
    font-size: 16px;
}

.detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.service-boxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.service-boxes div {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
}

.service-boxes strong,
.service-boxes span {
    display: block;
}

.service-boxes span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.product-info-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
}

.info-panel {
    padding: 22px;
}

.info-panel h2 {
    margin-top: 0;
}

.content-area {
    color: var(--text);
    line-height: 1.8;
}

.content-area img {
    border-radius: 16px;
    margin: 12px 0;
}

.spec-table {
    display: grid;
    gap: 10px;
}

.spec-table div {
    display: grid;
    grid-template-columns: minmax(120px, .55fr) 1fr;
    gap: 12px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
}

.spec-table strong {
    color: var(--text);
}

.spec-table span {
    color: var(--muted);
}

.section-block {
    padding: 22px;
    margin-top: 22px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-head h2 {
    margin: 8px 0 0;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -.04em;
}

.reviews-list {
    display: grid;
    gap: 12px;
}

.review-card {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
}

.review-card div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.review-card p {
    color: var(--muted);
    line-height: 1.7;
}

.review-card small {
    color: var(--muted);
    font-weight: 800;
}

.mobile-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 70;
    width: min(560px, calc(100% - 22px));
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(15,23,42,.14);
    border-radius: 22px;
    padding: 8px;
    display: none;
    grid-template-columns: repeat(5, 1fr);
}

.mobile-bottom-nav a {
    padding: 10px 4px;
    text-align: center;
    border-radius: 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.mobile-bottom-nav a.active {
    background: var(--soft-red);
    color: var(--primary);
}

.ufs-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%) translateY(20px);
    background: #111827;
    color: #fff;
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 18px 40px rgba(15,23,42,.22);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: 220ms ease;
}

.ufs-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 1050px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .service-boxes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 850px) {
    .ufsc-header {
        grid-template-columns: 1fr auto;
    }

    .top-search {
        grid-column: 1 / -1;
        order: 3;
    }

    .top-nav {
        display: none;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .filters {
        position: static;
    }

    .product-detail-layout,
    .product-info-grid {
        grid-template-columns: 1fr;
    }

    .gallery-card {
        position: static;
    }

    .listing-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-count,
    .brand-logo-large {
        width: 118px;
        height: 118px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .mobile-bottom-nav {
        display: grid;
    }
}

@media (max-width: 520px) {
    .ufsc-page {
        width: min(100% - 24px, 1200px);
    }

    .brand small {
        display: none;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        font-size: 13px;
    }

    .listing-hero,
    .product-summary,
    .gallery-card,
    .info-panel,
    .section-block {
        border-radius: 22px;
    }

    .listing-hero h1,
    .product-summary h1 {
        font-size: 30px;
    }

    .product-grid {
        gap: 10px;
    }

    .ufsc-product-body {
        padding: 12px;
    }

    .ufsc-product-title {
        font-size: 13px;
        min-height: 38px;
    }

    .ufsc-product-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .price-now {
        font-size: 17px;
    }

    .ufsc-card-actions {
        grid-template-columns: 1fr;
    }

    .btn-icon {
        display: none;
    }

    .detail-actions {
        grid-template-columns: 1fr;
    }

    .spec-table div {
        grid-template-columns: 1fr;
    }
}
