/**
 * NetStore Enterprise – Base Styles
 * CSS custom properties, reset, typography
 * Loaded on every page via default_head_blocks.xml
 */

/* ══════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES
══════════════════════════════════════════════════ */
:root {
    /* Brand colours */
    --ns-navy: #0d1f3c;
    --ns-navy-mid: #1a3258;
    --ns-blue: #1557b0;
    --ns-blue-light: #2468c8;
    --ns-accent: #0073e6;
    --ns-accent-hover: #005cbf;
    --ns-green: #1a7f4e;
    --ns-green-bg: #e8f5ee;
    --ns-red: #c0392b;
    --ns-gold: #d4a017;

    /* Text */
    --ns-text: #1c2435;
    --ns-text-muted: #5a6478;
    --ns-text-light: #8a95a8;

    /* Surfaces & borders */
    --ns-border: #dde3ec;
    --ns-border-light: #edf0f5;
    --ns-bg: #f7f9fc;
    --ns-bg-white: #ffffff;
    --ns-bg-section: #f0f4f9;

    /* Typography */
    --ns-font: "DM Sans", sans-serif;
    --ns-mono: "DM Mono", monospace;

    /* Shape */
    --ns-radius: 6px;
    --ns-radius-lg: 10px;

    /* Shadow */
    --ns-shadow:
        0 1px 4px rgba(13, 31, 60, 0.08), 0 4px 16px rgba(13, 31, 60, 0.06);
    --ns-shadow-md:
        0 2px 8px rgba(13, 31, 60, 0.1), 0 8px 32px rgba(13, 31, 60, 0.08);

    /* Transitions */
    --ns-transition: 0.18s ease;
}

/* ══════════════════════════════════════════════════
   RESET
══════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--ns-font);
    background: var(--ns-bg);
    color: var(--ns-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--ns-accent);
    text-decoration: none;
    transition: color var(--ns-transition);
}
a:hover {
    color: var(--ns-accent-hover);
    text-decoration: none;
}

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

button {
    font-family: var(--ns-font);
    cursor: pointer;
}

button:hover,
button:active,
button:focus {
    border: none;
    color: inherit;
    background: none;
    box-shadow: none;
}

ul,
ol {
    list-style: none;
}

/* ══════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════ */
@keyframes ns-fade-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes ns-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes pulseDot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.6);
    }
}

/* ══════════════════════════════════════════════════
   LAYOUT UTILITIES
══════════════════════════════════════════════════ */
.ns-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .ns-pdp__top {
        grid-template-columns: 1fr !important;
    }
    .ns-gallery {
        position: static !important;
    }
}
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    .ns-header__inner {
        height: 56px;
        gap: 16px;
    }
    .ns-header__search {
        max-width: 100%;
    }
    .ns-header__actions {
        display: none;
    }
    .ns-nav__inner {
        overflow-x: auto;
        white-space: nowrap;
    }
    .ns-product-info__quick-specs {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .ns-container {
        padding: 0 16px;
    }
    .ns-product-info__sku-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ══════════════════════════════════════════════════
   MAGENTO WRAPPER RESET & BREADCRUMB FIX
══════════════════════════════════════════════════ */
.ns-page-wrapper {
    width: 100%;
}

.page-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}
.page-main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}
/* Page title: ẩn mặc định, các trang cụ thể sẽ override */
.page-main > .page-title-wrapper {
    display: none !important;
}

.columns {
    padding: 0 !important;
    width: 100% !important;
}

/* Global content constraint — áp dụng cho tất cả trang
   trừ PDP (đã tự handle bằng .ns-pdp max-width) */
.column.main {
    width: 100% !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 24px 24px 48px !important;
    box-sizing: border-box !important;
    /* Reset Luma 2-column layout */
    float: none !important;
    order: unset !important;
    -ms-flex-order: unset !important;
    -webkit-order: unset !important;
}
/* PDP: tự handle bằng .ns-pdp */
.catalog-product-view .column.main {
    max-width: 100% !important;
    padding: 0 !important;
}
/* Category: tự handle bằng netstore-category.css */
.catalog-category-view .column.main {
    padding: 0 24px 48px !important;
}
/* Page title: ẩn chỉ trên PDP, các trang khác giữ nguyên */
.catalog-product-view .page-main > .page-title-wrapper {
    display: none !important;
}

/* Breadcrumb */
.breadcrumbs {
    max-width: 1280px;
    margin: 0 auto !important;
    padding: 12px 24px !important;
    text-align: left !important;
}
.breadcrumbs .items {
    font-size: 0.75rem !important;
    gap: 4px;
    justify-content: flex-start !important;
    text-align: left !important;
}
.breadcrumbs .item {
    text-align: left !important;
}
.breadcrumbs .item a {
    color: var(--ns-text-muted);
    font-size: 0.75rem;
    text-decoration: none;
}
.breadcrumbs .item a:hover {
    color: var(--ns-accent);
}
.breadcrumbs .item strong {
    color: var(--ns-text);
    font-weight: 500;
}
.breadcrumbs .item:not(:first-child)::before,
.breadcrumbs .items .item + .item::before {
    content: "›" !important;
    margin: 0 4px;
    color: var(--ns-border);
}
@media (max-width: 768px) {
    .breadcrumbs {
        padding: 10px 16px !important;
    }
}
@media (max-width: 480px) {
    .breadcrumbs {
        padding: 8px 12px !important;
    }
    .breadcrumbs .item:not(:last-child):not(:first-child) {
        display: none;
    }
    .breadcrumbs .item:nth-last-child(2):not(:first-child)::before {
        content: "… ›" !important;
        margin: 0 4px;
    }
}

.sections.nav-sections {
    margin-bottom: 2px;
}

/* ══════════════════════════════════════════════════
   MAGENTO MESSAGES
══════════════════════════════════════════════════ */
.page.messages {
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 0 !important;
}
.page.messages .messages {
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    min-height: 0 !important;
    line-height: normal !important;
}
.page.messages .message {
    margin: 8px 0 4px !important;
}

.message {
    position: relative !important;
    overflow: visible !important;
    display: block !important;
    padding: 13px 16px 13px 44px !important;
    box-sizing: border-box !important;
    border-radius: var(--ns-radius) !important;
    font-family: var(--ns-font) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1.55 !important;
    margin-bottom: 8px !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    background-image: none !important;
    animation: ns-fade-up 0.28s ease both !important;
}

/* Ẩn TẤT CẢ icon Magento/Luma */
.message::before,
.message > *::before,
.message > * > *::before,
.message-success > div::before,
.message-error > div::before,
.message-warning > div::before,
.message-notice > div::before {
    display: none !important;
    content: none !important;
    background: none !important;
    background-image: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Icon via ::after */
.message::after {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    content: "" !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    background-position: center !important;
}

.message-success,
.message.success {
    background: #e8f5ee !important;
    border-color: #b6e2cc !important;
    color: #145c38 !important;
}
.message-success::after,
.message.success::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231a7f4e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 8l4 4 8-8'/%3E%3C/svg%3E") !important;
}
.message-error,
.message.error {
    background: #fde8e6 !important;
    border-color: #f5c6c2 !important;
    color: #922b21 !important;
}
.message-error::after,
.message.error::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23c0392b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M8 5v3M8 11h.01'/%3E%3C/svg%3E") !important;
}
.message-warning,
.message.warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #78450a !important;
}
.message-warning::after,
.message.warning::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2l6 12H2z'/%3E%3Cpath d='M8 7v3M8 12h.01'/%3E%3C/svg%3E") !important;
}
.message-notice,
.message.notice,
.message-info,
.message.info {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}
.message-notice::after,
.message.notice::after,
.message-info::after,
.message.info::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M8 7v4M8 5h.01'/%3E%3C/svg%3E") !important;
}

/* ══════════════════════════════════════════════════
   PRODUCT CARD — dùng cho category, search, related
══════════════════════════════════════════════════ */
.ns-product-card {
    background: var(--ns-bg-white);
    border: 1px solid var(--ns-border);
    border-radius: var(--ns-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition:
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        transform 0.22s ease;
    animation: ns-fade-up 0.4s ease both;
    height: 100%;
}
.ns-product-card:hover {
    box-shadow: var(--ns-shadow-md);
    border-color: #c8d6eb;
    transform: translateY(-3px);
}
.ns-product-card__link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none !important;
    color: inherit;
}
.ns-product-card__img-wrap {
    background: var(--ns-bg-section);
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.ns-product-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: transform 0.4s cubic-bezier(0.22, 0.68, 0, 1.2);
    display: block;
}
.ns-product-card:hover .ns-product-card__img {
    transform: scale(1.07);
}
.ns-product-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 4px;
    color: white;
    z-index: 1;
}
.ns-product-card__badge--refurbished,
.ns-product-card__badge--refurb {
    background: linear-gradient(135deg, #1557b0, #0073e6);
}
.ns-product-card__badge--new {
    background: var(--ns-green);
}
.ns-product-card__badge--used {
    background: #6b7280;
}
.ns-product-card__body {
    padding: 14px 16px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ns-product-card__brand {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ns-accent);
}
.ns-product-card__name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ns-navy);
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ns-product-card__sku {
    font-family: var(--ns-mono);
    font-size: 0.7rem;
    color: var(--ns-text-light);
    margin-top: 2px;
}
.ns-product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--ns-border-light);
    gap: 8px;
    flex-wrap: wrap;
}
.ns-product-card__stock {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
}
.ns-product-card__stock--in {
    color: var(--ns-green);
}
.ns-product-card__stock--out {
    color: var(--ns-red);
}
.ns-product-card__stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ns-product-card__stock--in .ns-product-card__stock-dot {
    background: var(--ns-green);
}
.ns-product-card__stock--out .ns-product-card__stock-dot {
    background: var(--ns-red);
}
.ns-product-card__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}
.ns-product-card__price-final {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ns-navy);
}
.ns-product-card__price-old {
    font-size: 0.72rem;
    color: var(--ns-text-light);
    text-decoration: line-through;
}
.ns-product-card__action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ns-accent);
    background: rgba(0, 115, 230, 0.07);
    border-radius: 4px;
    padding: 5px 10px;
    margin-left: auto;
    transition: background 0.18s;
    white-space: nowrap;
}
.ns-product-card:hover .ns-product-card__action {
    background: rgba(0, 115, 230, 0.14);
}
.ns-product-card:nth-child(1) {
    animation-delay: 0.04s;
}
.ns-product-card:nth-child(2) {
    animation-delay: 0.08s;
}
.ns-product-card:nth-child(3) {
    animation-delay: 0.12s;
}
.ns-product-card:nth-child(4) {
    animation-delay: 0.16s;
}
.ns-product-card:nth-child(n + 5) {
    animation-delay: 0.2s;
}

/* Product grid — category/search */
.products-grid .product-items {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.products-grid .product-item {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}
@media (max-width: 1024px) {
    .products-grid .product-items {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 720px) {
    .products-grid .product-items {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .products-grid .product-items {
        grid-template-columns: 1fr !important;
    }
}
