/* 
========================================
  BASE STYLES & RESETS
======================================== 
*/

@import url('./variables.css');
@import url('./animations.css');

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

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

body {
  font-family: var(--font-body);
  background-color: var(--color-background);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
  margin-bottom: var(--space-sm);
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

ul, ol {
  list-style: none;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Layout Foundations --- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xl) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-subtitle {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
  color: var(--color-accent);
  display: block;
  margin-bottom: var(--space-xs);
}

/* --- Components --- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

.btn-primary:hover {
  background-color: var(--text-dark);
  color: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-primary);
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-surface);
}

.btn-accent:hover {
  background-color: #c49463; /* slightly darker accent */
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-primary);
  font-size: 1.25rem;
}

.btn-icon:hover {
  background-color: rgba(0,0,0,0.05);
}

/* Input Fields */
.input-group {
  margin-bottom: var(--space-sm);
}

.input-field {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition-fast);
  background: var(--color-surface);
}

.input-field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(212, 163, 115, 0.1);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 1rem 1.5rem;
  background: var(--color-surface);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease forwards;
  border-left: 4px solid var(--color-accent);
}

.toast.removing {
  animation: slideDown 0.3s ease reverse forwards;
}

/* Back to Top */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-surface);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
  z-index: var(--z-sticky);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-5px);
  background: var(--color-accent);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-sticky);
  transition: all var(--transition-smooth);
  padding: 1.5rem 0;
}

.navbar.scrolled {
  padding: 1rem 0;
  background: var(--overlay-bg);
  box-shadow: var(--shadow-soft);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.1em;
}

.logo .dot {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.cart-icon {
  position: relative;
}

.cart-count {
  position: absolute;
  top: 0px;
  right: 0px;
  background: var(--color-accent);
  color: var(--color-surface);
  font-size: 0.65rem;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn {
  display: none;
}

/* Search Overlay */
.search-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 10;
}

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

.search-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.search-input {
  flex: 1;
  border: none;
  font-size: 1.5rem;
  font-family: var(--font-heading);
  background: transparent;
  padding: 1rem 0;
}

.search-input:focus {
  outline: none;
}

.close-search {
  color: var(--color-primary);
}

/* --- Footer --- */
.footer {
  background: var(--color-primary);
  color: var(--color-surface);
  padding-top: var(--space-xl);
}

.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
}

.footer-brand h3 {
  color: var(--color-surface);
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.footer-brand .dot {
  color: var(--color-accent);
}

.footer-links h4 {
  color: var(--color-surface);
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
  font-family: var(--font-body);
}

.footer-links ul li {
  margin-bottom: var(--space-sm);
}

.footer-links ul li a {
  color: rgba(255,255,255,0.7);
}

.footer-links ul li a:hover {
  color: var(--color-accent);
}

.footer-newsletter h4 {
  color: var(--color-surface);
}

.footer-newsletter p {
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--space-md);
}

.newsletter-form {
  display: flex;
  gap: 10px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--space-md) 0;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 992px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-surface);
    padding: var(--space-md);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}


/* 
========================================
  ADMIN PANEL SPA STYLES
======================================== 
*/
.admin-body {
    background-color: var(--color-background);
    overflow: hidden; /* Prevent body scroll in SPA layout */
}

/* Login Overlay */
.admin-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.admin-login-card {
    background: var(--color-surface);
    padding: 3rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
}

/* Layout */
.admin-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--color-surface);
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.admin-sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.admin-sidebar-header h2 span {
    color: var(--color-accent);
}

.admin-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(212, 163, 115, 0.1);
    color: var(--color-accent);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.admin-nav-item {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-nav-item i {
    font-style: normal;
    font-size: 1.1rem;
}

.admin-nav-item:hover {
    background: rgba(0,0,0,0.02);
    color: var(--color-primary);
}

.admin-nav-item.active {
    background: rgba(212, 163, 115, 0.1);
    color: var(--color-accent);
    border-right: 3px solid var(--color-accent);
}

.admin-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Main Content Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-background);
    overflow: hidden;
}

.admin-topbar {
    height: 70px;
    background: var(--color-surface);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.admin-topbar-left h2 {
    font-size: 1.2rem;
    margin: 0;
}

.admin-content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Components: Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.stat-card .stat-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-primary);
    font-weight: 600;
}

.admin-panel-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Components: Tables */
.admin-table-container {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.02);
}

.admin-table tbody tr:hover {
    background: rgba(0,0,0,0.01);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-paid, .status-delivered { background: #d4edda; color: #155724; }
.status-failed, .status-cancelled { background: #f8d7da; color: #721c24; }
.status-shipped { background: #cce5ff; color: #004085; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--color-accent);
}
