/* ==========================================================================
   JEN & ALBERT PAMINTA - APPLICATION STYLES
   ========================================================================== */

/* Layout & Navigation */
.navbar {
  background: var(--color-vine-dark);
  border-bottom: 2px solid var(--color-gold-primary);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--color-gold-primary);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.4);
  object-fit: cover;
  background: #FAF6F0;
  transition: var(--transition);
}

.brand-logo:hover {
  transform: scale(1.05) rotate(2deg);
}

.brand-title {
  font-family: var(--font-serif-display);
  color: #FFFFFF;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
}

.brand-subtitle {
  font-family: var(--font-serif-elegant);
  color: var(--color-gold-light);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-style: normal;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: #E2E8E4;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--color-gold-light);
}

.cart-icon-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-gold);
  color: #FFFFFF;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.cart-icon-btn:hover {
  background: rgba(197, 160, 89, 0.2);
}

.cart-badge {
  background: var(--color-gold-primary);
  color: var(--color-vine-dark);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(180deg, var(--color-vine-dark) 0%, var(--color-vine-primary) 100%);
  color: #FFFFFF;
  padding: 4.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--color-gold-primary);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at center, rgba(197, 160, 89, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-emblem {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--color-gold-primary);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.45);
  margin-bottom: 1.5rem;
  background: #FAF6F0;
}

.hero-title {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  color: #FFFFFF;
  letter-spacing: 0.05em;
}

.hero-subtitle {
  font-family: var(--font-serif-elegant);
  font-size: 1.35rem;
  color: var(--color-gold-light);
  max-width: 650px;
  margin: 0 auto 2rem auto;
  font-style: italic;
}

/* Category Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 2.5rem 0 1.5rem 0;
}

.filter-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-parchment);
  color: var(--color-vine-dark);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--color-vine-primary);
  color: #FFFFFF;
  border-color: var(--color-vine-primary);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  padding: 1.5rem 0 3.5rem 0;
}

.product-card {
  background: #FFFFFF;
  border: 1px solid var(--border-parchment);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-gold);
}

.product-img-wrapper {
  height: 190px;
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--border-parchment);
}

.product-img {
  max-height: 80%;
  max-width: 80%;
  object-fit: contain;
}

.stock-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gold-deep);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.product-title {
  font-family: var(--font-serif-display);
  font-size: 1.05rem;
  color: var(--color-vine-dark);
  margin-bottom: 0.4rem;
}

.product-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-parchment);
}

.product-price {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-vine-dark);
}

/* Cart Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 36, 25, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: #FFFFFF;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-overlay.active .cart-drawer {
  right: 0;
}

.drawer-header {
  padding: 1.25rem;
  background: var(--color-vine-pale);
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-footer {
  padding: 1.25rem;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-parchment);
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-parchment);
}

/* Admin Dashboard Specifics */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 72px);
}

.admin-sidebar {
  width: 260px;
  background: var(--color-vine-dark);
  color: #FFFFFF;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  border-right: 2px solid var(--color-gold-primary);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #CBD5E1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-nav-item:hover, .sidebar-nav-item.active {
  background: var(--color-vine-primary);
  color: var(--color-gold-light);
  font-weight: 600;
}

.admin-content {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
  background: var(--bg-parchment);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--border-parchment);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-gold-primary);
}

.kpi-label {
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-family: var(--font-sans);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--color-vine-dark);
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.35rem;
}

/* POS Terminal Layout */
.pos-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  height: calc(100vh - 170px);
}

.pos-catalog {
  background: #FFFFFF;
  border: 1px solid var(--border-parchment);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-cart {
  background: #FFFFFF;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-item-tile {
  background: var(--bg-parchment);
  border: 1px solid var(--border-parchment);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pos-item-tile:hover {
  border-color: var(--color-gold-primary);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.pos-item-tile.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Print Receipt Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-receipt, #printable-receipt * {
    visibility: visible;
  }
  #printable-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    margin: 0 auto;
    padding: 10px;
    font-size: 12px;
    color: #000;
  }
}

/* ==========================================================================
   TABLET & MOBILE (CP) RESPONSIVE OPTIMIZATIONS
   ========================================================================== */

/* Tablets (iPad / Android Tablet: 768px - 1024px) */
@media (max-width: 1024px) {
  .pos-container {
    grid-template-columns: 1fr 340px;
    gap: 1rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .admin-content {
    padding: 1.25rem;
  }
}

/* Cellphones & Small Tablets (< 900px) */
@media (max-width: 900px) {
  .navbar {
    padding: 0.65rem 1rem;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    font-size: 0.7rem;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .nav-links a span:not(.cart-badge) {
    display: none; /* Icon-focused on mobile */
  }

  .admin-layout {
    flex-direction: column;
    position: relative;
  }

  .admin-sidebar {
    position: fixed;
    top: 60px;
    left: -280px;
    width: 270px;
    height: calc(100vh - 60px);
    z-index: 999;
    box-shadow: 5px 0 25px rgba(0,0,0,0.4);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .admin-sidebar.open {
    left: 0;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(0,0,0,0.5);
    z-index: 998;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .pos-container {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .pos-catalog {
    max-height: 480px;
  }

  .pos-cart {
    max-height: none;
    margin-top: 1rem;
  }

  .hero-section {
    padding: 3rem 1rem;
  }

  .hero-emblem {
    width: 100px;
    height: 100px;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
  }
}

/* Small Cellphones (< 600px) */
@media (max-width: 600px) {
  .hero-title {
    font-size: 1.55rem;
  }

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

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

  .custom-table th, .custom-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
  }

  .modal-box {
    padding: 0;
  }

  .modal-header, .modal-body, .modal-footer {
    padding: 1rem;
  }

  .btn {
    padding: 0.6rem 1rem;
  }
}

/* Unit Choices Pills */
.btn-unit-pill {
  background: #FFFFFF;
  border: 1px solid var(--border-gold);
  color: var(--color-vine-dark);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.btn-unit-pill:hover {
  background: var(--color-gold-pale);
  border-color: var(--color-gold-deep);
}
.btn-unit-pill.active {
  background: var(--color-vine-primary);
  border-color: var(--color-vine-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(39, 74, 57, 0.25);
}



