/* =============================
    User Dashboard Full CSS
   ============================= */

/* ---- Reset and Base ---- */
body {
    min-height: 100vh;
    background: #f7f9fa;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #222;
    position: relative;
    margin: 0;
    padding-bottom: 60px; /* footer offset */
}

/* ---- Header ---- */
.header {
    background: #163058;
    color: #ffc800;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    font-size: 1.45rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
    box-sizing: border-box;
}

.header .logo {
    display: flex;
    align-items: center;
    font-size: 1.45rem;
    font-weight: 700;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.notification-wrap, .user-avatar {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.notification-bell {
    font-size: 1.25rem;
    color: #ffc800;
    position: relative;
}
.notif-count {
    position: absolute;
    top: -5px; right: -8px;
    background: #e70d14;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 50%;
    width: 18px; height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-initials {
    width: 34px; height: 34px;
    background: #ffc800;
    color: #163058;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin-right: 7px;
    text-transform: uppercase;
    border: 2px solid #ffc800;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 18px rgba(20,30,90,0.09);
    z-index: 111;
    min-width: 150px;
    padding: 10px 0 5px 0;
}
.user-avatar:focus-within .dropdown-menu,
.user-avatar:hover .dropdown-menu,
.notification-wrap:focus-within .dropdown-menu,
.notification-wrap:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: #1b3055;
    padding: 9px 24px;
    display: block;
    text-decoration: none;
    font-size: 1.08rem;
    border-bottom: 1px solid #eee;
    transition: background .13s;
}
.dropdown-menu a:last-child { border-bottom: none; }
.dropdown-menu a:hover {
    background: #f7f9fa;
    color: #ffc800;
}

.user-label { font-size: 1.05rem; color: #ffc800; }

@media (max-width: 900px) {
    .header { font-size: 1.1rem; padding: 0 10px; height: 54px;}
    .avatar-initials { width: 30px; height: 30px; font-size: 0.95rem;}
    .notif-count { font-size: 0.8rem; width: 14px; height: 14px;}
}
/* ---- Page Container ---- */
.page-container {
    margin-left: 210px;
    padding-top: 100px; /* <-- ADD THIS for space below header (header height + extra allowance) */
    padding-bottom: 60px;
    min-height: calc(100vh - 60px);
}
@media (max-width: 900px) {
    .page-container {
        margin-left: 0;
        margin-top: 90px;
        padding-top: 96px;
    }
}

/* ---- Sidebar ---- */
.sidebar {
    min-height: 100vh;
    background: #f6fdf6;
    border-right: 1px solid #eee;
    padding-top: 32px;
    width: 210px;
    position: fixed;
    top: 68px; /* <-- make sure this matches the header height */
    left: 0;
    bottom: 0;
    z-index: 10;
    box-sizing: border-box;
    font-size: 1.1rem;
}
.sidebar a {
    display: block;
    color: #1b3055;
    text-decoration: none;
    padding: 14px 26px 14px 28px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
    border-radius: 13px 0 0 13px;
    margin-bottom: 4px;
}
.sidebar a.active, .sidebar a:hover {
    background: #fff;
    color: #163058;
}
.upgrade-btn {
    background: #FFC800;
    color: #163058;
    font-weight: bold;
    border-radius: 15px;
    display: block;
    margin: 30px 18px 0 18px;
    text-align: center;
    padding: 15px 0;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: 0.15s;
    box-shadow: 0 2px 8px rgba(22,48,88,0.04);
}
.upgrade-btn:hover { background: #ffd93b; }
.sidebar-btn-yellow {
    background: #FFD600;
    color: #222;
    font-weight: bold;
    padding: 10px 18px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: block;
    text-align: left;
    transition: background 0.2s;
}
.sidebar-btn-yellow:hover {
    background: #FFC400;
}

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100vw;
        top: 0;
        min-height: unset;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-top: 8px;
        padding-bottom: 12px;
        border-radius: 0 0 18px 18px;
        z-index: 35;
    }
    .sidebar a, .upgrade-btn {
        border-radius: 11px;
        margin: 0 14px 8px 14px;
        font-size: 1.05rem;
        padding: 13px 0 13px 18px;
    }
}
/* ---- Main Content Box ---- */
.main-content {
    background: #fff;
    border-radius: 25px;
    box-shadow: 0 8px 24px rgba(18,28,53,.07);
    margin: 40px auto 0 auto;
    padding: 30px 40px;
    max-width: 1200px; /* adjust if needed for products page */
    min-height: 500px;
    z-index: 1;
    position: relative;
}
.main-content.shop-products {
    max-width: 1200px;
}

.content-box {
    background: #fff;
    box-shadow: 0 4px 24px 0 rgba(27, 36, 49, 0.07);
    border-radius: 24px;
    padding: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.section-header {
    background: #162b54;
    padding: 10px 24px;
    border-radius: 16px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #FFC800;
    letter-spacing: 1px;
}

.category-box {
    margin-bottom: 32px;
}
.category-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 12px 0 18px 4px;
    color: #162b54;
    letter-spacing: 0.5px;
}
.product-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.product-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 10px 0 rgba(27, 36, 49, 0.06);
    padding: 18px;
    min-width: 210px;
    max-width: 230px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow .18s;
}
.product-card:hover {
    box-shadow: 0 6px 30px 0 rgba(27,36,49,0.16);
}

.product-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 12px;
    background: #f3f3f3;
}

.product-info {
    text-align: center;
}
.product-name {
    font-size: 1.08rem;
    font-weight: bold;
    margin: 5px 0;
    color: #1b2531;
}
.product-desc {
    font-size: 0.92rem;
    color: #555;
    margin-bottom: 7px;
}
.product-price {
    font-size: 1.04rem;
    color: #162b54;
    font-weight: 600;
    margin-bottom: 2px;
}
.product-rp {
    font-size: 0.98rem;
    color: #FFC800;
    margin-bottom: 10px;
}
.btn-cart {
    background: #162b54;
    color: #FFC800;
    border: none;
    padding: 7px 24px;
    border-radius: 9px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background .2s;
}
.btn-cart:hover {
    background: #FFC800;
    color: #162b54;
    border: 1px solid #162b54;
}

@media (max-width: 900px) {
    .main-content {
        padding: 24px 12px;
        margin: 24px auto 0 auto;
        max-width: 98vw;
    }
}
@media (max-width: 520px) {
    .main-content {
        padding: 12px 4px;
        margin: 12px auto 0 auto;
        min-width: unset;
        max-width: 100vw;
    }
}

/* ---- Headings and Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #163058;
    margin-bottom: 12px;
}
h1 { font-size: 2rem; font-weight: bold; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }
.bold { font-weight: bold; }

/* ---- Table and Card Styles ---- */
.table, table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 18px;
    font-size: 1.03rem;
}
.table th, table th {
    background: #163058;
    color: #ffc800;
    font-weight: bold;
    padding: 13px 10px;
}
.table td, table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e6e7eb;
}
.status-pending {
    color: #ffc800;
    font-weight: bold;
}
.status-active {
    color: #2ecc40;
    font-weight: bold;
}

/* ---- Notification Bell --- */
.header .notification-bell {
    font-size: 2.2rem;
    color: #ffc800;
    position: relative;
    margin-right: 18px;
    cursor: pointer;
}

/* ---- Button Styles ---- */
button, .btn {
    background: #163058;
    color: #ffc800;
    border: none;
    padding: 10px 24px;
    font-size: 1.07rem;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 6px 8px 0;
    transition: background .12s;
}
button:hover, .btn:hover {
    background: #ffc800;
    color: #163058;
}

input[type="text"], input[type="number"], select, textarea {
    border: 1.2px solid #eee;
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
    margin-bottom: 8px;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
    border-color: #ffc800;
    outline: none;
}

/* ---- Highlighted Message/Box ---- */
.highlight {
    background: #fff5c5;
    border-radius: 14px;
    padding: 17px 16px;
    font-size: 1.1rem;
    color: #222;
    margin-bottom: 18px;
}
@media (max-width: 520px) {
    .highlight { padding: 10px 6px; font-size: 0.97rem; }
}

/* ---- Footer ---- */
.footer {
    width: 100%;
    height: 56px;
    background: #163058;
    color: #ffc800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 99;
    letter-spacing: 0.4px;
}
@media (max-width: 900px) {
    .footer { font-size: 0.93rem; }
}

/* ---- Misc. ---- */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 20px; }

::-webkit-scrollbar {
    width: 8px; background: #f7f9fa;
}
::-webkit-scrollbar-thumb {
    background: #ececec; border-radius: 8px;
}
.main-content {
    background: #fff;
    border-radius: 25px;
    box-shadow: 0 8px 24px rgba(18,28,53,.07);
    margin: 40px auto;
    padding: 30px 40px;
    max-width: 900px;
    min-height: 500px;
}
.section-title {
    background: #142d53;
    color: #ffc800;
    font-size: 2rem;
    font-weight: bold;
    padding: 14px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    margin-bottom: 30px;
}
.products-wrapper {
    width: 100%;
}
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: flex-start;
}
.product-card {
    background: #f8fafc;
    border-radius: 18px;
    box-shadow: 0 2px 10px 0 rgba(18,28,53,.07);
    padding: 20px 22px 16px 22px;
    width: 240px;
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    transition: box-shadow 0.18s;
}
.product-card:hover {
    box-shadow: 0 8px 24px 0 rgba(18,28,53,.14);
}
.product-card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 14px;
    background: #eee;
}
.img-placeholder {
    width: 120px; height: 120px;
    background: #eee;
    color: #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.92rem;
}
.product-info {
    width: 100%;
    text-align: center;
    margin-bottom: 12px;
}
.product-category {
    color: #233978;
    font-size: 0.92rem;
    font-weight: 500;
}
.product-title {
    font-size: 1.13rem;
    font-weight: 700;
    color: #163058;
    margin-bottom: 2px;
}
.product-desc {
    font-size: 0.98rem;
    color: #444;
    margin-bottom: 4px;
}
.product-price {
    font-size: 1.1rem;
    color: #FFC800;
    font-weight: bold;
    margin-bottom: 4px;
}
.product-points {
    color: #233978;
    font-size: 0.97rem;
    margin-bottom: 6px;
}
.add-cart-btn {
    background: #FFC800;
    color: #163058;
    font-weight: 700;
    border: none;
    border-radius: 7px;
    padding: 9px 20px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 4px;
    box-shadow: 0 1px 4px rgba(18,28,53,.09);
    transition: background 0.2s, color 0.2s;
}
.add-cart-btn:hover {
    background: #142d53;
    color: #ffc800;
}
.no-products {
    text-align: center;
    color: #999;
    padding: 60px 0;
    font-size: 1.15rem;
}
.dashboard-section ul { list-style: disc; padding-left: 24px;}
.dashboard-section li { background: #f9f9fa; border-radius: 6px; padding: 12px; margin-bottom:8px;}
.dashboard-section h3 { margin-bottom: 12px; color: #012a5b;}

/* === Layout & centering against sidebar === */
:root{
  --content-max: 1280px;
  --content-pad: 16px;
}

/* gumagana to dahil nag-iinject tayo ng .with-sidebar sa <html> */
html.with-sidebar body > .page,
html.with-sidebar .page{
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--content-pad);
  /* panigurado laban sa sobrang dikit sa sidebar */
  padding-left: calc(var(--content-pad) + 4px);
}

/* sa mas malalaking screen, dagdagan ng kaunting breathing room sa left */
@media (min-width: 1200px){
  html.with-sidebar .page{
    padding-left: calc(var(--content-pad) + 10px);
  }
}

/* Mobile: no left push, full width */
@media (max-width: 991px){
  html.with-sidebar .page{
    padding: 12px;
    padding-top: 16px;
  }
}

/* === Section titles / header pill spacing === */
.page .section-title,
.section-title{
  margin: 10px 0 16px 0;
}

/* === Product grid niceties (safe even kung iba class names mo) === */
.page .products-grid,
.products-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

/* 3-up desktop, 2-up tablet, 1-up mobile; adjust as you like */
.product-card{ grid-column: span 4; }
@media (max-width: 1199px){ .product-card{ grid-column: span 6; } }
@media (max-width: 767px){  .product-card{ grid-column: span 12; } }

/* Cards: tighter padding para hindi bulky */
.product-card{
  padding: 14px;
  border-radius: 14px;
}

/* Image figure: maintain aspect, no overflow */
.product-card .product-image{
  display:block;
  width:100%;
  height:auto;
  border-radius: 10px;
  overflow: hidden;
}

/* === Compact action buttons === */
.product-card .actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.product-card .btn,
.product-card button,
.product-card a.button{
  padding: 8px 12px;
  font-size: 0.95rem;
  line-height: 1.1;
  border-radius: 10px;
}

/* maliit pa sa mobile para hindi mag-stack nang pangit */
@media (max-width: 767px){
  .product-card .btn,
  .product-card button,
  .product-card a.button{
    padding: 7px 10px;
    font-size: 0.92rem;
    border-radius: 9px;
  }
  /* 2-per-row layout look */
  .product-card .actions > *{
    flex: 1 1 calc(50% - 10px);
    text-align: center;
  }
}

/* === Sidebar CTA text wrap / truncation fix === */
.sidebar .cta,
.sidebar .cta-merchant{
  white-space: normal;         /* allow wrap */
  word-break: break-word;      /* break long words */
  line-height: 1.15;
  padding: 10px 12px;
  font-size: 0.98rem;
}

/* Kapag collapsed (desktop icon-only), itago label ng CTA para hindi umusli */
.sidebar.collapsed .cta .label,
.sidebar.collapsed .cta-merchant .label{
  display:none;
}

/* === Ensure header sits above slide-in sidebar overlay cleanly === */
.header{ z-index: 1100; position: relative; }

/* === Slight shrink on left nav labels para mas siksik === */
.sidebar a .label{ font-size: 0.98rem; }

/* Active link bolder pero hindi sumisigaw */
.sidebar a.active{ font-weight: 700; }
