/* ═══════════════════════════════════════════════════════════
   MinhTamCoconut — product.css
   Trang danh sách & chi tiết sản phẩm
═══════════════════════════════════════════════════════════ */

/* ── PAGE HEADER ───────────────────────────────────────── */
.page-header {
    background: linear-gradient(160deg, var(--g0) 0%, var(--g1) 100%);
    padding: 120px 8% 56px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

    .page-header::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle, rgba(58,170,86,0.12) 1px, transparent 1px);
        background-size: 28px 28px;
        pointer-events: none;
    }

.page-header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.page-header-left {
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 12px;
    list-style: none;
}

    .breadcrumb li + li::before {
        content: '/';
        margin-right: 6px;
        color: var(--g3);
    }

    .breadcrumb a {
        color: var(--g5);
        text-decoration: none;
    }

        .breadcrumb a:hover {
            text-decoration: underline;
        }

.page-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    color: var(--ink);
    line-height: 1.1;
}

    .page-title em {
        font-style: italic;
        color: var(--g5);
    }

.page-count {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 8px;
}

/* ── SEARCH BAR ─────────────────────────────────────────── */
.search-wrap {
    position: relative;
    min-width: 280px;
}

.search-input {
    width: 100%;
    padding: 11px 44px 11px 18px;
    border: 1.5px solid var(--g2);
    border-radius: 30px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: var(--ink);
    background: white;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

    .search-input:focus {
        border-color: var(--g4);
        box-shadow: 0 0 0 3px rgba(58,170,86,0.1);
    }

    .search-input::placeholder {
        color: var(--muted);
    }

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1rem;
    transition: color 0.2s;
}

    .search-btn:hover {
        color: var(--g5);
    }

/* ── FILTER TABS ────────────────────────────────────────── */
.filter-bar {
    background: white;
    border-bottom: 1px solid var(--line);
    padding: 0 8%;
    position: sticky;
    top: 70px;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(58,170,86,0.06);
}

.filter-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

.filter-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 16px 22px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.25s;
}

    .filter-tab:hover {
        color: var(--g5);
    }

    .filter-tab.active {
        color: var(--g5);
        border-bottom-color: var(--g5);
        font-weight: 600;
    }

.filter-tab-count {
    background: var(--g1);
    color: var(--g6);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.filter-tab.active .filter-tab-count {
    background: var(--g5);
    color: white;
}

/* ── PRODUCT GRID LAYOUT ────────────────────────────────── */
.product-page {
    padding: 48px 8% 80px;
    background: white;
}

.product-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ── PRODUCT CARD ───────────────────────────────────────── */
.prod-card-v {
    background: white;
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    transition: all 0.35s ease;
    display: flex;
    flex-direction: column;
}

    .prod-card-v:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 55px rgba(58,170,86,0.13);
        border-color: var(--g3);
    }

.pcv-img {
    /* Tỉ lệ 1:1 cố định — KHÔNG thay đổi dù ảnh nào upload lên */
    aspect-ratio: 1 / 1;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Xóa height cứng — aspect-ratio tự tính */
}

.pcv-img-emoji {
    font-size: 5.5rem;
    filter: drop-shadow(0 8px 18px rgba(58,170,86,0.22));
    animation: softFloat 4s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes softFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.pcv-img-photo {
    /* contain: hiện toàn bộ ảnh, không crop, không méo */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px; /* khoảng trắng quanh ảnh */
    transition: transform 0.4s ease;
}

.prod-card-v:hover .pcv-img-photo {
    transform: scale(1.04);
}

.pcv-img-shine {
    position: absolute;
    top: 10%;
    left: 16%;
    width: 32%;
    height: 16%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.55), transparent);
    border-radius: 50%;
    transform: rotate(-15deg);
    pointer-events: none;
    z-index: 2;
}

/* Màu nền theo danh mục */
.pcv-img.bg-finished {
    background: linear-gradient(150deg, var(--g1), var(--g2));
}

.pcv-img.bg-raw {
    background: linear-gradient(150deg, #fff8e6, #fce7b4);
}

.pcv-img.bg-topping {
    background: linear-gradient(150deg, #e6f4ff, #b9d9f5);
}

.pcv-img.bg-gift {
    background: linear-gradient(150deg, #f5e6ff, #dbb9f5);
}

.pcv-img.bg-default {
    background: linear-gradient(150deg, var(--g0), #c0f0cc);
}

/* Badge */
.pcv-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-hot {
    background: rgba(230,65,65,0.12);
    color: #d63f3f;
    border: 1px solid rgba(230,65,65,0.2);
}

.badge-new {
    background: rgba(58,170,86,0.12);
    color: var(--g6);
    border: 1px solid rgba(58,170,86,0.2);
}

.badge-b2b {
    background: rgba(200,151,58,0.12);
    color: var(--gold);
    border: 1px solid rgba(200,151,58,0.25);
}

.badge-sale {
    background: rgba(130,90,210,0.1);
    color: #7848c8;
    border: 1px solid rgba(130,90,210,0.2);
}

/* Card body */
.pcv-body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pcv-cat {
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--g5);
    font-weight: 700;
    margin-bottom: 7px;
}

.pcv-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
    line-height: 1.3;
}

.pcv-desc {
    font-size: 0.81rem;
    color: var(--ink-soft);
    line-height: 1.7;
    margin-bottom: 14px;
    flex: 1;
}

.pcv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 16px;
}

.pcv-tag {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.67rem;
    font-weight: 500;
    background: var(--g0);
    border: 1px solid var(--g2);
    color: var(--g6);
}

.pcv-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.pcv-price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--g5);
}

.pcv-price-unit {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    color: var(--muted);
    margin-left: 2px;
}

.pcv-price-old {
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: line-through;
    margin-left: 6px;
    font-family: 'DM Sans', sans-serif;
}

.pcv-price-contact {
    font-size: 0.88rem;
    color: var(--g6);
    font-weight: 600;
}

.pcv-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pcv-add {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--g4), var(--g6));
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--shadow-g);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
}

    .pcv-add:hover {
        transform: scale(1.12) rotate(90deg);
        box-shadow: 0 8px 22px var(--shadow-g);
        color: white;
    }

.pcv-detail {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--g5);
    font-weight: 600;
    text-decoration: none;
    transition: gap 0.25s;
    white-space: nowrap;
}

    .pcv-detail:hover {
        gap: 9px;
    }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.empty-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--ink);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 24px;
}

/* ── PAGINATION ─────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 56px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s;
    border: 1.5px solid var(--line);
    color: var(--ink-soft);
    background: white;
    padding: 0 8px;
}

    .page-btn:hover {
        border-color: var(--g4);
        color: var(--g5);
        background: var(--g0);
    }

    .page-btn.active {
        background: var(--g5);
        color: white;
        border-color: var(--g5);
        box-shadow: 0 4px 14px var(--shadow-g);
        pointer-events: none;
    }

    .page-btn.disabled {
        opacity: 0.35;
        pointer-events: none;
    }

.page-dots {
    color: var(--muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

/* ══════════════════════════════════════════════════════════
   PRODUCT DETAIL PAGE
══════════════════════════════════════════════════════════ */

.detail-wrap {
    padding: 48px 8% 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

/* ── Detail: Image panel ────────────────────────────────── */
.detail-img-panel {
    position: sticky;
    top: 100px;
}

.detail-img-main {
    height: 440px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    margin-bottom: 14px;
}

    .detail-img-main.bg-finished {
        background: linear-gradient(150deg, var(--g1), var(--g2));
    }

    .detail-img-main.bg-raw {
        background: linear-gradient(150deg, #fff8e6, #fce7b4);
    }

    .detail-img-main.bg-topping {
        background: linear-gradient(150deg, #e6f4ff, #b9d9f5);
    }

    .detail-img-main.bg-gift {
        background: linear-gradient(150deg, #f5e6ff, #dbb9f5);
    }

    .detail-img-main.bg-default {
        background: linear-gradient(150deg, var(--g0), #c0f0cc);
    }

.detail-img-emoji {
    font-size: 10rem;
    filter: drop-shadow(0 16px 32px rgba(58,170,86,0.3));
    animation: softFloat 4s ease-in-out infinite;
}

.detail-img-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 32px;
    z-index: 1;
}

/* Badges detail */
.detail-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-badge {
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Detail: Info panel ─────────────────────────────────── */
.detail-info {
}

.detail-cat {
    font-size: 0.68rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--g5);
    font-weight: 700;
    margin-bottom: 10px;
}

.detail-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 300;
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 20px;
}

/* Price block */
.detail-price-block {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 20px 24px;
    border-radius: 18px;
    background: var(--g0);
    border: 1px solid var(--line);
    margin-bottom: 24px;
}

.detail-price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--g5);
}

.detail-price-unit {
    font-size: 0.8rem;
    color: var(--muted);
}

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

.detail-discount {
    margin-left: auto;
    background: rgba(230,65,65,0.1);
    color: #d63f3f;
    border: 1px solid rgba(230,65,65,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* Description */
.detail-desc {
    font-size: 0.95rem;
    color: var(--ink-soft);
    line-height: 1.85;
    margin-bottom: 24px;
}

/* Tags */
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 28px;
}

.detail-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--g0);
    border: 1px solid var(--g2);
    color: var(--g6);
}

/* Add to cart block */
.detail-cart-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--g2);
    border-radius: 30px;
    overflow: hidden;
    background: white;
}

.qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: none;
    font-size: 1.1rem;
    color: var(--g6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

    .qty-btn:hover {
        background: var(--g1);
    }

.qty-input {
    width: 44px;
    text-align: center;
    border: none;
    outline: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    -moz-appearance: textfield;
}

    .qty-input::-webkit-inner-spin-button {
        display: none;
    }

.btn-add-cart {
    flex: 1;
    padding: 13px 20px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, var(--g5), var(--g6));
    color: white;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 22px var(--shadow-g);
    transition: all 0.3s;
}

    .btn-add-cart:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 28px var(--shadow-g);
    }

.btn-contact-price {
    flex: 1;
    padding: 13px 20px;
    border-radius: 30px;
    background: var(--g0);
    color: var(--g6);
    border: 1.5px solid var(--g3);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

    .btn-contact-price:hover {
        background: var(--g1);
        border-color: var(--g5);
    }

/* Specs table */
.detail-specs {
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 28px;
}

.spec-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

    .spec-row:last-child {
        border-bottom: none;
    }

.spec-label {
    width: 140px;
    flex-shrink: 0;
    padding: 13px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-mid);
    background: var(--g0);
    border-right: 1px solid var(--line);
}

.spec-value {
    padding: 13px 18px;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

/* ── RELATED PRODUCTS ───────────────────────────────────── */
.related-sec {
    padding: 64px 8%;
    background: var(--ivory);
    border-top: 1px solid var(--line);
}

.related-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 36px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1100px) {
    .product-layout {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-wrap {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .detail-img-panel {
        position: static;
    }

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

@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
    }

    .page-header {
        padding: 100px 5% 40px;
    }

    .product-page {
        padding: 36px 5% 60px;
    }

    .filter-bar {
        padding: 0 5%;
    }

    .detail-wrap {
        padding: 36px 5% 60px;
    }

    .related-sec {
        padding: 48px 5%;
    }

    .related-grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-cart-block {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        gap: 5px;
    }

    .page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}


/* V7 — mobile filter tabs visibility */
@media (max-width: 768px) {
    .filter-bar {
        top: 64px;
        padding: 0 4%;
    }
    .filter-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scroll-snap-type: x proximity;
        padding-bottom: 6px;
    }
    .filter-tabs::-webkit-scrollbar {
        display: block;
        height: 4px;
    }
    .filter-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
        padding: 14px 16px;
    }
}
