/* ============================================================================
   YAI theme — BicBen public site
   Save to: /var/www/yai/public/css/yai-theme.css
   ============================================================================ */

:root {
    --yai-blue:      #1e3a8a;   /* navy used in XD navbar */
    --yai-blue-dk:   #142862;
    --yai-blue-lt:   #3b5bdb;
    --yai-red:       #ef4444;   /* red login button */
    --yai-red-dk:    #b91c1c;
    --yai-bg:        #f5f6f8;
    --yai-card:      #ffffff;
    --yai-border:    #e5e7eb;
    --yai-muted:     #6b7280;
}

* {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--yai-bg);
    color: #1f2937;
}

/* ---------- NAVBAR ------------------------------------------------------- */

.yai-navbar {
    background: var(--yai-blue);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.yai-logo img {
    max-height: 44px;
}

.yai-nav {
    list-style: none;
    gap: 8px;
}

.yai-nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 500;
    transition: background .15s;
}

.yai-nav a:hover, .yai-nav a.active {
    background: rgba(255,255,255,.15);
}

.yai-icon-btn {
    background: transparent;
    border: 0;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background .15s;
}

.yai-icon-btn:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}

.yai-login-btn {
    background: var(--yai-red);
    color: #fff;
    padding: 7px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.yai-login-btn:hover {
    background: var(--yai-red-dk);
    color: #fff;
}

/* ---------- BREADCRUMB ---------------------------------------------------- */

.yai-breadcrumb a {
    color: var(--yai-blue);
    text-decoration: none;
}
.yai-breadcrumb a:hover { text-decoration: underline; }

/* ---------- CARDS / SHELLS ------------------------------------------------ */

.yai-card-shell {
    background: var(--yai-card);
    border: 1px solid var(--yai-border);
    border-radius: 12px;
}

/* ---------- CATEGORY CARDS (Product Main) -------------------------------- */

.yai-cat-card {
    display: block;
    background: var(--yai-card);
    border: 1px solid var(--yai-border);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    cursor: pointer;
}

.yai-cat-card:hover {
    transform: translateY(-3px);
    border-color: var(--yai-blue-lt);
    box-shadow: 0 6px 20px rgba(30,58,138,.12);
}

.yai-cat-card-image {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: var(--yai-blue);
}

.yai-cat-card-body {
    padding: 10px;
}

/* ---------- BRAND CARDS (Series view) ------------------------------------- */

.yai-brand-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--yai-card);
    border: 1px solid var(--yai-border);
    border-radius: 10px;
    padding: 14px 10px;
    height: 70px;
    text-decoration: none;
    color: #374151;
    transition: all .15s;
}

.yai-brand-card:hover {
    border-color: var(--yai-blue);
    color: var(--yai-blue);
}

.yai-brand-card.active {
    border-color: var(--yai-blue);
    background: #eef2ff;
    color: var(--yai-blue);
}

/* ---------- CATEGORY SIDEBAR --------------------------------------------- */

.yai-cat-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.yai-cat-list a {
    display: block;
    padding: 6px 10px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
}

.yai-cat-list a:hover { background: #f3f4f6; }

.yai-cat-list a.active {
    background: #eef2ff;
    color: var(--yai-blue);
    font-weight: 600;
}

/* ---------- PRODUCT CARD -------------------------------------------------- */

.yai-product-card {
    background: var(--yai-card);
    border: 1px solid var(--yai-border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: all .15s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.yai-product-card:hover {
    border-color: var(--yai-blue-lt);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.yai-product-card-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.yai-product-card-img {
    background: #f9fafb;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.yai-product-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.yai-product-card-body {
    padding: 10px 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.yai-product-sku {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--yai-muted);
    margin-bottom: 2px;
}

.yai-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}

.yai-cart-btn {
    background: var(--yai-blue);
    color: #fff;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.yai-cart-btn:hover { background: var(--yai-blue-dk); }

/* ---------- FOOTER -------------------------------------------------------- */

.yai-footer {
    background: var(--yai-blue);
    color: #fff;
}

.yai-footer a:hover { color: #fff !important; }

/* ---------- PAGINATION ---------------------------------------------------- */

.pagination .page-link {
    color: var(--yai-blue);
    border-color: var(--yai-border);
}

.pagination .page-item.active .page-link {
    background-color: var(--yai-blue);
    border-color: var(--yai-blue);
}

/* ---------- RESPONSIVE TWEAKS -------------------------------------------- */

@media (max-width: 768px) {
    .yai-nav { display: none !important; }   /* TODO: add a mobile hamburger drawer */
}

/* Ensure user-menu dropdown sits above any sticky-top sidebar (cart summary, etc.) */
.dropdown-menu {
    z-index: 1100 !important;
}

/* Also keep the main navbar above sticky page sections */
.yai-navbar {
    z-index: 1030;
}
