@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ================================================= */
/* ===================== RESET ===================== */
/* ================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100dvh;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: "Inter", sans-serif;
    background: radial-gradient(circle at 50% -20%, #263044 0, #0c0f14 40%, #080a0d 75%);
    color: #f5f5f5;
    min-height: 100dvh;
    min-height: 100vh;
}

/* ================================================= */
/* ====================== LOGO ===================== */
/* ================================================= */

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.logo span {
    display: inline-flex;
    align-items: center;
    background: #fff;
    color: #080a0d;
    padding: 5px 7px;
    border-radius: 6px;
}

.logo b {
    color: #a3e635;
}

.logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    margin-left: 4px;
}

/* ================================================= */
/* =========== HEADER — GLASS ====================== */
/* ================================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(70px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    z-index: 1000;
    background: rgba(12, 16, 22, 0.75);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.10);
}

.header-inner {
    width: 100%;
    max-width: 1220px;
    height: 70px;
    margin: auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ================================================= */
/* ============ SEARCH ============================= */
/* ================================================= */

.search {
    width: 250px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: 0.25s;
}

.search:focus-within {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.08);
}

.search span {
    font-size: 23px;
    color: #888;
}

.search input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: white;
    font-size: 13px;
}

.search input::placeholder {
    color: #777;
}

/* ================================================= */
/* ========= TAB BAR — DESKTOP (DỌC BÊN PHẢI) ====== */
/* ================================================= */

.tab-bar {
    position: fixed;
    top: 50%;
    right: 16px;
    left: auto;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px;
    background: rgba(12, 16, 22, 0.85);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: visible;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 10px 14px;
    min-width: 100px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.12);
}

.tab-btn.active {
    color: #111;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.15);
}

/* ================================================= */
/* ============= TAB CONTENT ======================= */
/* ================================================= */

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFadeIn 0.35s ease;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================= */
/* ======================= MAIN ==================== */
/* ================================================= */

main {
    max-width: 1180px;
    margin: auto;
    padding: calc(145px + env(safe-area-inset-top, 0px)) 20px calc(145px + env(safe-area-inset-bottom, 0px)) 20px;
}

/* ================================================= */
/* ======================== TOP ==================== */
/* ================================================= */

.top {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 35px;
}

.eyebrow {
    color: #777;
    font-size: 11px;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

h1 {
    font-size: 48px;
    line-height: 1;
    letter-spacing: -3px;
}

h1 span {
    color: #777;
}

.count {
    color: #666;
    font-size: 13px;
}

.count strong {
    color: white;
    font-size: 22px;
}

/* ================================================= */
/* ========= FILTER + SORT ========================= */
/* ================================================= */

.filters,
.sort {
    position: sticky;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    background: rgba(20, 26, 36, 0.72);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.18);
    overflow-x: auto;
    scrollbar-width: none;
}

.filters::-webkit-scrollbar,
.sort::-webkit-scrollbar {
    display: none;
}

.filters {
    top: calc(85px + env(safe-area-inset-top, 0px));
    margin-bottom: 8px;
}

.sort {
    top: calc(151px + env(safe-area-inset-top, 0px));
    margin-bottom: 30px;
}

/* ================================================= */
/* =============== FILTER BUTTON =================== */
/* ================================================= */

.filter {
    flex-shrink: 0;
    height: 38px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.filter:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.12);
}

.filter.active {
    color: #111;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* ================================================= */
/* ===================== PRODUCTS ================== */
/* ================================================= */

.phone-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    padding-top: 8px;
}

/* ================================================= */
/* ======================= CARD ==================== */
/* ================================================= */

.phone-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14);
    opacity: 0;
    transform: translateY(25px) scale(0.97);
    animation: cardIn 0.55s forwards;
    transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), border-color 0.35s, box-shadow 0.35s;
    cursor: pointer;
}

.phone-card:hover {
    transform: translateY(-8px) scale(1.015);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), 0 20px 60px rgba(0, 0, 0, 0.45);
}

.phone-card::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 300px;
    top: -100px;
    left: -150px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
    transform: rotate(25deg);
    transition: 0.7s;
    pointer-events: none;
}

.phone-card:hover::after {
    left: 120%;
}

/* ================================================= */
/* ======================= IMAGE =================== */
/* ================================================= */

.phone-image {
    height: 270px;
    background: radial-gradient(circle, #242933, #101318);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.phone-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(.2, .8, .2, 1);
}

.phone-card:hover .phone-image img {
    transform: scale(1.07);
}

/* ================================================= */
/* ====================== STATUS =================== */
/* ================================================= */

.phone-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 10px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.phone-status-available {
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-color: rgba(52, 211, 153, 0.75);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.phone-status-deposit {
    color: #3d2400;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: rgba(251, 191, 36, 0.75);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.35);
}

.phone-status-sold {
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: rgba(248, 113, 113, 0.75);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.phone-status-available:hover,
.phone-status-deposit:hover,
.phone-status-sold:hover {
    transform: translateY(-1px);
}

/* ================================================= */
/* ======================== INFO =================== */
/* ================================================= */

.phone-info {
    padding: 17px;
}

.phone-brand {
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 7px;
}

.phone-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.phone-price {
    font-size: 18px;
    font-weight: 700;
    color: #8cff7c;
}

/* ================================================= */
/* ================= CARD ANIMATION ================ */
/* ================================================= */

@keyframes cardIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ================================================= */
/* =============== FOOTER ========================== */
/* ================================================= */

footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: calc(65px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1000;
    background: rgba(12, 16, 22, 0.75);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.06);
    padding-left: max(20px, calc((100% - 1180px) / 2));
    padding-right: max(20px, calc((100% - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #888;
}

.footer-left span {
    color: #aaa;
    font-weight: 700;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact small {
    color: #666;
    margin-right: 4px;
}

/* ================================================= */
/* ================= CONTACT ICON ================== */
/* ================================================= */

.contact-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-icon.zalo {
    background: #0068ff;
    color: white;
}

.contact-icon.facebook {
    background: #1877f2;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 20px;
}

.contact-icon.zalo-group {
    width: auto;
    min-width: 42px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 11px;
    letter-spacing: 0.3px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.contact-icon:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.contact-icon.zalo-group:hover {
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), 0 8px 25px rgba(16, 185, 129, 0.45);
}

/* ================================================= */
/* ============= UTILITY LIST ====================== */
/* ================================================= */

.utility-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.utility-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14);
    transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), border-color 0.35s, box-shadow 0.35s;
}

.utility-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.20), 0 20px 60px rgba(0, 0, 0, 0.40);
}

.utility-image {
    width: 100%;
    height: 180px;
    background: radial-gradient(circle, #242933, #101318);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.utility-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.utility-image-placeholder {
    font-size: 48px;
    opacity: 0.4;
}

.utility-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 16px;
}

.utility-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.3;
    word-break: break-word;
}

.utility-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
    flex: 1;
}

.utility-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.utility-btn {
    flex: 1;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.utility-btn-copy {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.utility-btn-copy:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
}

.utility-btn-copy.copied {
    background: rgba(80, 220, 130, 0.15);
    border-color: rgba(80, 220, 130, 0.35);
    color: #75e39b;
}

.utility-btn-download {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-color: rgba(52, 211, 153, 0.5);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.utility-btn-download:hover {
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.utility-btn-open {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.utility-btn-open:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}

.utility-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
}

/* ================================================= */
/* ====================== MODAL ==================== */
/* ================================================= */

.product-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.product-modal.show {
    opacity: 1;
    visibility: visible;
}

.product-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 14, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    will-change: opacity;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-modal.show .product-modal-overlay {
    opacity: 1;
}

.product-modal-box {
    position: relative;
    width: min(900px, 92vw);
    max-width: 900px;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(30, 36, 48, 0.88), rgba(14, 18, 26, 0.92));
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.60), inset 0 1px 1px rgba(255, 255, 255, 0.28);
    transform: translateY(18px) scale(0.97);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    transition-delay: 0.04s;
}

.product-modal.show .product-modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.product-modal-box::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -30%;
    width: 160%;
    height: 80%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.14), transparent 60%);
    pointer-events: none;
    transform: rotate(-10deg);
    opacity: 0.8;
    z-index: 1;
}

.product-modal-box::-webkit-scrollbar {
    width: 4px;
}

.product-modal-box::-webkit-scrollbar-track {
    background: transparent;
}

.product-modal-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.product-modal-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.30);
}

.product-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 50;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: #ddd;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    transition: 0.25s;
}

.product-modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

.product-modal-content {
    position: relative;
    z-index: 2;
    padding: 32px;
}

.modal-product-image {
    width: 100%;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 25px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.10);
    overflow: hidden;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14);
}

.modal-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 70px;
    overflow: hidden;
    box-sizing: border-box;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

#modal-image {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 82% !important;
    max-height: 82% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
    transform: none !important;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
}

.modal-image-nav {
    position: absolute !important;
    top: 50% !important;
    width: 46px !important;
    height: 46px !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: blur(12px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 30px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    cursor: pointer;
    z-index: 20 !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 6px 18px rgba(0, 0, 0, 0.30) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease !important;
}

.modal-image-nav:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.42) !important;
}

.modal-image-nav:active {
    transform: translateY(-50%) scale(0.92) !important;
}

.modal-image-prev {
    left: 14px !important;
    right: auto !important;
}

.modal-image-next {
    right: 14px !important;
    left: auto !important;
}

.modal-image-nav.hidden {
    display: none !important;
}

.modal-image-counter {
    position: absolute !important;
    left: 50% !important;
    bottom: 4px !important;
    transform: translateX(-50%) !important;
    z-index: 20 !important;
    padding: 3px 9px !important;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.modal-image-counter.hidden {
    display: none !important;
}

.modal-brand {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.modal-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-name-row h2 {
    flex: 1;
    min-width: 0;
}

.product-modal-content h2 {
    margin: 0;
    color: white;
    font-size: 32px;
    letter-spacing: -1.5px;
}

.modal-status {
    display: inline-flex;
    margin-top: 14px;
    padding: 6px 10px;
    border-radius: 20px;
    background: rgba(80, 220, 130, 0.1);
    border: 1px solid rgba(80, 220, 130, 0.18);
    color: #75e39b;
    font-size: 11px;
    font-weight: 600;
}

.modal-price {
    margin-top: 20px;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.modal-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 25px;
}

.modal-info-item {
    position: relative;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    min-width: 0;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.10);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.modal-info-item:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
}

.modal-info-item > span {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.modal-info-item strong {
    display: block;
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

.modal-info-wide {
    grid-column: 1 / -1;
}

.modal-description {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.10);
}

.description-title {
    color: white;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.modal-description p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.description-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.description-title-row .description-title {
    margin-bottom: 0;
}

.copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.copy-row strong {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.copy-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    border-color: rgba(255, 255, 255, 0.22);
}

.copy-btn:active {
    transform: scale(0.88);
}

.copy-btn.copied {
    background: rgba(80, 220, 130, 0.15);
    border-color: rgba(80, 220, 130, 0.3);
    color: #75e39b;
}

.download-all-images {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.download-all-images:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
}

.download-all-images:active {
    transform: scale(0.99);
}

.download-all-images:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* ================================================= */
/* ================= IMAGE LIGHTBOX ================ */
/* ================================================= */

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.image-lightbox.show {
    opacity: 1;
    visibility: visible;
}

.image-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
}

#image-lightbox-img {
    position: relative;
    z-index: 2;
    max-width: 92vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    transform: scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-out;
}

.image-lightbox.show #image-lightbox-img {
    transform: scale(1);
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: 0.25s;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

.image-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    width: 52px;
    height: 52px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: 0.25s;
}

.image-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.18);
}

.image-lightbox-nav:active {
    transform: translateY(-50%) scale(0.92);
}

.image-lightbox-prev {
    left: 20px;
}

.image-lightbox-next {
    right: 20px;
}

.image-lightbox-nav.hidden {
    display: none !important;
}

.image-lightbox-counter {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 10;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.image-lightbox-counter.hidden {
    display: none !important;
}

/* ================================================= */
/* ===================== TABLET ==================== */
/* ================================================= */

@media (max-width: 1000px) {
    .phone-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================================= */
/* ===================== MOBILE ==================== */
/* ================================================= */

@media (max-width: 700px) {

    .header {
        height: calc(62px + env(safe-area-inset-top, 0px));
        background: rgba(10, 14, 20, 0.92);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .header-inner {
        padding: 0 15px;
        height: 62px;
    }

       /* TAB BAR - MOBILE (CĂN GIỮA BÊN PHẢI) */
    .tab-bar {
        position: fixed;
        /* Dùng 50vh để căn giữa màn hình thực tế, tránh bị thanh địa chỉ đẩy lệch */
        top: 50vh; 
        right: 10px;
        left: auto;
        
        transform: translateY(-50%);
        
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 5px;
        
        /* Ép khung ôm sát nội dung */
        width: max-content;
        height: auto;
        z-index: 999;
    }

    .tab-btn {
        padding: 8px 10px;
        min-width: 0; /* Xóa bỏ độ rộng tối thiểu */
        width: 100%;
        font-size: 11px;
        gap: 5px;
        justify-content: flex-start;
        white-space: nowrap;
    }

    .search {
        width: 180px;
    }

    main {
        padding: calc(90px + env(safe-area-inset-top, 0px)) 20px calc(160px + env(safe-area-inset-bottom, 0px));
    }

    .filters,
    .sort {
        position: static;
        margin-bottom: 12px;
        padding: 7px 8px;
        background: rgba(20, 26, 36, 0.92);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .filter {
        height: 36px;
        padding: 0 13px;
        font-size: 11px;
    }

    h1 {
        font-size: 38px;
    }

    .phone-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .phone-image {
        height: 210px;
    }

    .utility-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .utility-image {
        height: 140px;
    }

    .utility-info {
        padding: 12px;
    }

    .utility-title {
        font-size: 14px;
    }

    .utility-desc {
        font-size: 11px;
    }

    .utility-btn {
        min-width: 0;
        padding: 8px 10px;
        font-size: 11px;
    }

    footer {
        height: calc(58px + env(safe-area-inset-bottom, 0px));
        padding-left: 15px;
        padding-right: 15px;
        background: rgba(10, 14, 20, 0.92);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .product-modal {
        padding: 12px;
    }

    .product-modal-box {
        width: 96vw;
        max-width: 96vw;
        max-height: 94vh;
        border-radius: 22px;
        background: rgba(18, 22, 30, 0.96);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .product-modal-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(0, 0, 0, 0.75);
    }

    .modal-product-image {
        height: 280px;
    }

    .modal-image-wrapper {
        padding: 15px 48px;
    }

    #modal-image {
        max-width: 82% !important;
        max-height: 82% !important;
    }

    .product-modal-content {
        padding: 25px 20px;
    }

    .product-modal-content h2 {
        font-size: 26px;
    }

    .modal-price {
        font-size: 24px;
    }

    .modal-info {
        grid-template-columns: 1fr 1fr;
    }

    .modal-image-nav {
        width: 40px !important;
        height: 40px !important;
        font-size: 26px !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(0, 0, 0, 0.65) !important;
    }

    .modal-image-prev {
        left: 8px !important;
    }

    .modal-image-next {
        right: 8px !important;
    }

    .modal-image-counter {
        bottom: 2px !important;
        font-size: 9px;
        padding: 2px 7px !important;
    }

    .download-all-images {
        font-size: 13px;
        padding: 11px 14px;
    }

    .image-lightbox {
        padding: 20px;
    }

    #image-lightbox-img {
        max-width: 96vw;
        max-height: 86vh;
    }

    .image-lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 25px;
    }

    .image-lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 28px;
    }

    .image-lightbox-prev {
        left: 10px;
    }

    .image-lightbox-next {
        right: 10px;
    }

    .image-lightbox-counter {
        bottom: 14px;
        font-size: 11px;
        padding: 5px 12px;
    }
}

/* ================================================= */
/* ================= SMALL MOBILE ================== */
/* ================================================= */

@media (max-width: 450px) {
    .logo {
        font-size: 14px;
    }

    .logo img {
        width: 30px;
        height: 30px;
    }

    .search {
        width: 145px;
        height: 36px;
    }

    .search span {
        font-size: 20px;
    }

    .search input {
        font-size: 11px;
    }


    main {
        padding: calc(85px + env(safe-area-inset-top, 0px)) 12px calc(170px + env(safe-area-inset-bottom, 0px));
    }

    .top {
        margin-bottom: 20px;
    }

    h1 {
        font-size: 32px;
    }

    .count {
        font-size: 11px;
    }

    .count strong {
        font-size: 18px;
    }

    .phone-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .phone-image {
        height: 180px;
    }

    .phone-info {
        padding: 13px;
    }

    .phone-name {
        font-size: 15px;
    }

    .phone-price {
        font-size: 15px;
    }

    .utility-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .utility-image {
        height: 160px;
    }

    .footer-contact small {
        display: none;
    }

    .contact-icon {
        width: 32px;
        height: 32px;
    }

    .modal-product-image {
        height: 250px !important;
    }

    .modal-image-wrapper {
        padding: 12px 44px !important;
    }

    #modal-image {
        max-width: 80% !important;
        max-height: 80% !important;
    }

    .product-modal-content {
        padding: 20px 16px;
    }

    .modal-info-item {
        padding: 12px;
    }
}

/* ================================================= */
/* ============== PWA STANDALONE =================== */
/* ================================================= */

@media all and (display-mode: standalone) {
    html {
        height: 100vh;
    }

    body {
        min-height: 100vh;
        padding-top: env(safe-area-inset-top, 0px);
    }

    main {
        padding-top: calc(100px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    }
}

/* ================================================= */
/* ============== PWA INSTALL BANNER =============== */
/* ================================================= */

.pwa-install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: linear-gradient(145deg, rgba(30, 40, 55, 0.98), rgba(15, 20, 30, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    animation: pwaSlideUp 0.4s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pwa-install-banner[hidden] {
    display: none;
}

@keyframes pwaSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pwa-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: #0c0f14;
    padding: 4px;
    flex-shrink: 0;
}

.pwa-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pwa-banner-text strong {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-text span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-btn-install {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transition: 0.2s;
}

.pwa-btn-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.55);
}

.pwa-btn-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}

.pwa-btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

@media (min-width: 769px) {
    .pwa-install-banner {
        display: none !important;
    }
}


/* THÔNG BÁO BẢO TRÌ */
.maintenance-notice {
    position: fixed;
    top: 70px; /* Nằm ngay dưới Header */
    left: 0;
    width: 100%;
    z-index: 999;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #fff;
    padding: 10px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideDown 0.5s ease;
}

.maintenance-content {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 14px;
    text-align: center;
    position: relative;
}

#close-maintenance {
    position: absolute;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

#close-maintenance:hover {
    background: rgba(255,255,255,0.4);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Mobile */
@media (max-width: 700px) {
    .maintenance-notice { top: 62px; font-size: 13px; padding: 8px 35px 8px 10px;}
    #close-maintenance { right: 5px; }
}