@import "admin-styles.css";

/* --- CSS Reset & Variables --- */
:root {
  /* Colors */
  --primary: #007BFF;
  /* Brand Blue */
  --primary-hover: #0056b3;
  --secondary: #6C5CE7;
  /* Soft Purple */
  --accent: #FFD166;
  /* Warm Yellow */
  --accent-hover: #FFC033;

  /* Backgrounds */
  --bg-main: #FAF9F6;
  /* Off-white */
  --bg-card: #FFFFFF;
  --bg-subtle: #F3F4F6;

  /* Text */
  --text-main: #2D3436;
  --text-muted: #636E72;
  --text-light: #FFFFFF;

  /* Structural */
  --border-color: rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
  --shadow-playful: 4px 4px 0px rgba(0, 0, 0, 0.9);
  --shadow-playful-hover: 2px 2px 0px rgba(0, 0, 0, 0.9);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-pill: 9999px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-main: #121212;
  --bg-card: #1E1E1E;
  --bg-subtle: #2D2D2D;

  --text-main: #FDFDFD;
  --text-muted: #A0AEC0;

  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-playful: 4px 4px 0px rgba(255, 255, 255, 0.2);
  --shadow-playful-hover: 2px 2px 0px rgba(255, 255, 255, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.font-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- Reusable Components --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-light);
  box-shadow: var(--shadow-playful);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-playful-hover);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.icon-btn:hover {
  background-color: var(--bg-subtle);
}

/* --- Navigation --- */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(var(--bg-card-rgb, 255, 255, 255), 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

[data-theme="dark"] .navbar {
  background: rgba(30, 30, 30, 0.8);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  transform: rotate(-5deg);
  transition: var(--transition);
}

.logo:hover .logo-icon {
  transform: rotate(5deg) scale(1.1);
}

.site-logo-img {
  height: 40px;
  width: auto;
  border-radius: var(--radius-sm);
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

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

.cart-toggle {
  background-color: var(--bg-subtle);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 4rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  min-height: 80vh;
}

.hero-bg-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
  top: -10%;
  left: -5%;
  width: 300px;
  height: 300px;
  background-color: var(--accent);
}

.shape-2 {
  bottom: 10%;
  right: -5%;
  width: 400px;
  height: 400px;
  background-color: var(--secondary);
  animation-delay: -5s;
}

.shape-3 {
  top: 40%;
  left: 40%;
  width: 250px;
  height: 250px;
  background-color: var(--primary);
  animation-duration: 15s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(30px, -30px) scale(1.1);
  }
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: rgba(255, 209, 102, 0.2);
  color: #D49D1C;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 209, 102, 0.4);
}

[data-theme="dark"] .badge {
  color: var(--accent);
}

.hero-title {
  font-size: clamp(3rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 90%;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  perspective: 1000px;
}

.floating-card {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative;
  transform: rotateY(-10deg) rotateX(5deg);
  animation: hover3d 6s infinite ease-in-out alternate;
  transform-style: preserve-3d;
}

@keyframes hover3d {
  0% {
    transform: translateY(0) rotateY(-10deg) rotateX(5deg);
  }

  100% {
    transform: translateY(-20px) rotateY(-5deg) rotateX(10deg);
  }
}

.hero-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: cover;
  aspect-ratio: 4/3;
}

.floating-badge {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: bold;
  box-shadow: var(--shadow-md);
  z-index: 10;
  transform: translateZ(50px);
}

.top-right {
  top: -20px;
  right: -20px;
  background-color: var(--accent);
  color: #6C4200;
}

.bottom-left {
  bottom: -20px;
  left: -20px;
  background-color: var(--primary);
  color: white;
  font-size: 0.9rem;
  border-radius: 12px;
  transform: rotate(-15deg) translateZ(40px);
}

/* --- Features --- */
.features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 3rem 1.5rem;
  background-color: var(--accent);
  color: #4A3A11;
  flex-wrap: wrap;
  border-top: 4px solid var(--bg-card);
  border-bottom: 4px solid var(--bg-card);
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 250px;
  max-width: 300px;
}

.feature-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.feature-icon .material-icons-round {
  font-size: 2rem;
}

.feature-item h3 {
  font-size: 1.25rem;
}

.feature-item p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* --- Shop Section --- */
.shop-section {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.category-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  background-color: var(--bg-card);
  padding: 0.5rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: relative;
  margin: 0 auto;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Floating tab clone (always fixed, only translates) ── */
.category-tabs-clone {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  /* hidden below screen */
  z-index: 998;
  background: rgba(var(--bg-card-rgb, 255, 255, 255), 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 123, 255, 0.15);
  margin: 0;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

.category-tabs-clone.clone-visible {
  transform: translateX(-50%) translateY(0);
  /* slides into view */
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .category-tabs-clone {
  background: rgba(30, 30, 30, 0.92);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 123, 255, 0.2);
}

/* Clone: hide the slider (it won't align), style active tab directly instead */
.category-tabs-clone .tab-slider {
  display: none;
}

.category-tabs-clone .tab-btn.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

.category-tabs-clone .tab-btn:not(.active) {
  color: var(--text-muted);
}

.category-tabs-clone {
  overflow: visible;
  white-space: nowrap;
  flex-wrap: nowrap;
}


.tab-slider {
  position: absolute;
  background-color: var(--primary);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 0;
  pointer-events: none;
}

.tab-btn {
  padding: 0.75rem 2rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.tab-btn.active {
  color: white;
}

.draggable-tab {
  cursor: grab;
}

.draggable-tab:active {
  cursor: grabbing;
}

.tab-btn.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  background-color: var(--bg-hover);
  border: 1px dashed var(--primary);
}

.tab-btn.drag-over {
  border: 2px dashed var(--primary);
  background-color: rgba(0, 123, 255, 0.1);
  transform: scale(1.05);
}

/* Sort Bar */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-bar label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.sort-bar select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.sort-bar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.product-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  overflow: hidden;
  margin-bottom: 1.25rem;
  position: relative;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-img {
  transform: scale(1.08);
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: bold;
  color: white;
  z-index: 2;
}

.badge-sale {
  background-color: var(--primary);
}

.badge-new {
  background-color: var(--secondary);
}

.product-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.product-category {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.price-strike {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: line-through;
  margin-left: 0.5rem;
  font-weight: 400;
}

.add-to-cart {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  border: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.product-card:hover .add-to-cart {
  background-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* --- Forms & Inputs --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-left: 0.2rem;
  font-family: var(--font-body);
}

.auth-input,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}

.auth-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.auth-input:disabled,
.form-group select:disabled {
  opacity: 0.6;
  background-color: var(--bg-subtle);
  cursor: not-allowed;
}

/* --- Newsletter --- */
.newsletter {
  padding: 5rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.newsletter-card {
  background: linear-gradient(135deg, var(--secondary), #4A35B0);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .newsletter-card {
  background: linear-gradient(135deg, #4A3B9A, #2D2360);
}

.newsletter-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.newsletter-card h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.newsletter-card p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.newsletter-form input {
  flex-grow: 1;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-pill);
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1rem;
}

.newsletter-form .btn {
  box-shadow: none;
}

/* --- Footer --- */
.footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 5rem 1.5rem 2rem;
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 1rem;
  max-width: 300px;
}

.footer-links h3,
.footer-social h3 {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  background-color: var(--bg-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: var(--font-heading);
  transition: var(--transition);
}

.social-icon:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-3px);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.legal-links a:hover {
  color: var(--primary);
}

/* --- Cart Sidebar --- */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -450px;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background-color: var(--bg-card);
  z-index: 2001;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.empty-cart-msg {
  text-align: center;
  color: var(--text-muted);
  margin-top: 2rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  background-color: var(--bg-main);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.cart-item-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.cart-item-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-title {
  font-weight: 600;
  font-family: var(--font-heading);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.cart-item-price {
  color: var(--primary);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-pill);
  padding: 0.25rem;
  border: 1px solid var(--border-color);
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.qty-btn:hover {
  background: var(--primary);
  color: white;
}

.remove-btn {
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
}

.remove-btn:hover {
  color: var(--primary);
  text-decoration: underline;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-main);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: bold;
  font-family: var(--font-heading);
  margin-bottom: 1.5rem;
}

.checkout-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 2rem;
    gap: 2rem;
  }

  .hero-subtitle {
    margin: 0 auto 2rem;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-visual {
    max-width: 500px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .newsletter-form {
    flex-direction: column;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .product-view-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .main-image-container {
    aspect-ratio: auto !important;
  }
}

/* ===== MOBILE LAYOUT (phone-size screens) ===== */
@media (max-width: 480px) {

  /* -- Navbar: compact -- */
  .nav-container {
    padding: 0.5rem 0.75rem;
  }

  .site-logo-img {
    height: 28px;
  }

  .logo-text {
    font-size: 1.1rem;
    letter-spacing: 0;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .icon-btn .material-icons-round {
    font-size: 20px;
  }

  .nav-actions {
    gap: 0.15rem;
  }

  .nav-actions .icon-btn {
    margin-right: 4px !important;
  }

  .cart-badge {
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
    top: -1px;
    right: -1px;
  }

  .btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }

  /* -- Shop Section: tight spacing -- */
  .shop-section {
    margin: 1rem auto;
    padding: 0 0.75rem;
  }

  .section-header {
    margin-bottom: 1.5rem;
  }

  .section-title {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
  }

  .section-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  /* -- Category tabs: compact pills -- */
  .category-tabs {
    gap: 0.35rem;
    padding: 0.3rem;
  }

  .tab-btn {
    padding: 0.45rem 1rem;
    font-size: 0.75rem;
  }

  /* -- Sort bar: compact -- */
  .sort-bar {
    margin-top: 0.5rem;
  }

  .sort-bar label {
    font-size: 0.7rem;
  }

  .sort-bar select {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }

  /* -- Floating tabs: compact on mobile -- */
  .category-tabs-clone {
    bottom: 1rem;
    max-width: 95vw;
  }

  /* -- Product grid: 2 columns -- */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  /* -- Product cards: compact -- */
  .product-card {
    padding: 0.5rem;
    border-radius: var(--radius-md);
  }

  .product-card:hover {
    transform: translateY(-3px);
  }

  .product-img-wrap {
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
  }

  .product-badge {
    top: 5px;
    left: 5px;
    padding: 0.15rem 0.4rem;
    font-size: 0.6rem;
  }

  .product-info {
    padding: 0;
  }

  .product-title {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-category {
    font-size: 0.55rem;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
  }

  .product-footer {
    margin-top: 0.35rem;
  }

  .product-price {
    font-size: 0.85rem;
  }

  .price-strike {
    font-size: 0.65rem;
    margin-left: 0.25rem;
  }

  .add-to-cart {
    width: 28px;
    height: 28px;
  }

  .add-to-cart .material-icons-round {
    font-size: 16px;
  }

  /* -- Pagination: compact -- */
  #pagination-controls {
    margin-top: 1.5rem !important;
    margin-bottom: 1rem !important;
    gap: 0.5rem !important;
  }

  #pagination-controls .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  #page-indicator {
    font-size: 0.75rem !important;
  }

  /* -- Product detail view: stacked vertically -- */
  .product-view-section {
    padding: 1rem 0.75rem !important;
  }

  .product-view-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .main-image-container {
    aspect-ratio: 4/3 !important;
    border-radius: var(--radius-md) !important;
  }

  .main-image-container img {
    object-fit: cover !important;
  }

  #pv-title {
    font-size: 1.4rem !important;
  }

  #pv-price {
    font-size: 1.2rem !important;
  }

  #pv-description {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1rem !important;
  }

  #pv-category {
    font-size: 0.75rem !important;
  }

  .thumbnail-gallery img {
    height: 45px;
    width: 45px;
  }

  .back-to-shop-btn {
    margin-bottom: 1rem !important;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  /* -- Newsletter: compact -- */
  .newsletter-card {
    padding: 1.5rem 1rem;
  }

  .newsletter-card h2 {
    font-size: 1.2rem;
  }

  .newsletter-card p {
    font-size: 0.8rem;
  }

  .social-links-large {
    flex-direction: column;
    gap: 0.5rem;
  }

  .social-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  /* -- Footer: tight -- */
  .footer-bottom {
    padding: 1rem !important;
  }

  .footer-bottom p {
    font-size: 0.75rem;
  }

  /* -- Admin banner: compact, no gap -- */
  .admin-tools-banner {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    margin-bottom: 0;
    top: 45px;
  }

  .admin-tools-banner+.shop-section,
  .admin-tools-banner~#main-content .shop-section {
    margin-top: 0.5rem;
  }

  .admin-tools-banner .material-icons-round {
    font-size: 16px;
  }

  /* -- Admin edit header: no overlap -- */
  #admin-header-edit-container {
    position: static !important;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  /* -- Modals: full width, scrollable on mobile -- */
  .modal-overlay {
    padding: 0.5rem !important;
    align-items: flex-start !important;
    padding-top: 2rem !important;
  }

  .modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 88vh;
    margin: 0 auto;
    overflow-y: auto;
  }

  .modal-header {
    padding: 1rem !important;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 0.75rem 1rem !important;
    overflow-y: auto;
  }

  .modal-actions {
    padding: 0.75rem 1rem !important;
  }

  .form-group label {
    font-size: 0.8rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 0.85rem !important;
    padding: 0.6rem !important;
  }

  .form-row {
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* -- Cart sidebar: full width, proper height -- */
  .cart-sidebar {
    max-width: 100% !important;
    width: 100% !important;
    height: 100dvh;
    right: -100% !important;
  }

  .cart-sidebar.active {
    right: 0 !important;
  }

  .cart-header {
    padding: 0.75rem 1rem;
  }

  .cart-header h2 {
    font-size: 1.1rem;
  }

  .cart-items {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .cart-item {
    padding: 0.6rem;
    gap: 0.6rem;
  }

  .cart-item-img {
    width: 50px;
    height: 50px;
  }

  .cart-item-title {
    font-size: 0.8rem;
  }

  .cart-item-price {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }

  .cart-footer {
    padding: 0.75rem 1rem;
    flex-shrink: 0;
  }

  .cart-total {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .checkout-btn {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  /* -- Checkout view: mobile -- */
  .checkout-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  #checkout-view {
    padding: 1rem 0.75rem !important;
  }

  #checkout-view h2 {
    font-size: 1.3rem !important;
    margin-bottom: 1rem !important;
  }

  .checkout-card {
    padding: 1rem !important;
  }

  .checkout-card h3 {
    font-size: 0.95rem !important;
  }

  /* -- Profile view: compact -- */
  #profile-view {
    max-height: 65vh !important;
  }

  #profile-tabs button {
    font-size: 0.85rem !important;
    padding: 0.35rem !important;
  }

  /* -- Error page -- */
  #error-view .material-icons-round {
    font-size: 50px !important;
  }

  #error-view h2 {
    font-size: 1.5rem !important;
  }

  #error-view p {
    font-size: 0.95rem !important;
  }
}

/* Tablet-ish (480-768px): still force 2 cols + moderate sizing */
@media (min-width: 481px) and (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .product-card {
    padding: 0.75rem;
  }

  .product-title {
    font-size: 0.9rem;
  }

  .product-price {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 0.85rem;
  }

  .shop-section {
    margin: 1.5rem auto;
    padding: 0 1rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .tab-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
  }
}

/* --- Product Details View --- */
.thumbnail-gallery img {
  height: 60px;
  width: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
  transition: var(--transition);
}

.thumbnail-gallery img:hover {
  opacity: 1;
}

.thumbnail-gallery img.active {
  opacity: 1;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* --- Skeleton Loading Screen --- */
#app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-main);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.skeleton-nav {
  height: 73px;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skeleton-nav-left {
  width: 150px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.skeleton-nav-right {
  display: flex;
  gap: 15px;
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-btn {
  width: 80px;
  height: 40px;
  border-radius: var(--radius-pill);
}

.skeleton-body {
  flex-grow: 1;
  max-width: 1400px;
  margin: 3rem auto;
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.skeleton-title {
  width: 300px;
  height: 40px;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.skeleton-subtitle {
  width: 450px;
  height: 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 2.5rem;
}

.skeleton-tabs {
  width: 250px;
  height: 50px;
  border-radius: var(--radius-pill);
  margin-bottom: 4rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
  width: 100%;
}

.skeleton-card {
  height: 380px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.skeleton-animate {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border-color) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
}

[data-theme="dark"] .skeleton-animate {
  background: linear-gradient(90deg, var(--bg-card) 25%, #333 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* --- Category Animations --- */
@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.category-slide-in {
  opacity: 0;
  animation: slideInFromRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* --- Inline Search + Sort Row (below category tabs) --- */
.search-sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.inline-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.75rem 0.4rem 1rem;
  min-width: 200px;
  max-width: 280px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.inline-search-wrap:focus-within,
.inline-search-wrap.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12), var(--shadow-md);
}

.inline-search-icon {
  color: var(--text-muted);
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.inline-search-wrap:focus-within .inline-search-icon,
.inline-search-wrap.active .inline-search-icon {
  color: var(--primary);
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--text-main);
  padding: 0.35rem 0;
  min-width: 0;
}

#search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.inline-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
  padding: 0;
}

.inline-search-clear .material-icons-round {
  font-size: 16px;
}

.inline-search-clear:hover {
  background: var(--primary);
  color: white;
}

/* Mobile: search-sort-row stays horizontal, search shrinks */
@media (max-width: 768px) {
  .search-sort-row {
    gap: 0.5rem;
  }

  .inline-search-wrap {
    min-width: 0;
    max-width: none;
    flex: 1;
  }
}

/* --- Floating Chat Widget --- */
.floating-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
  transform: translateY(0);
  transition: transform 0.3s ease, bottom 0.3s ease, right 0.3s ease;
}

.chat-toggle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  background-color: var(--primary-hover);
}

.chat-toggle-btn .material-icons-round {
  font-size: 28px;
  transition: transform 0.3s ease;
}

.chat-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom center;
}

.floating-chat-widget.active .chat-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.floating-chat-widget.active .chat-toggle-btn {
  background-color: #ef4444;
}

.floating-chat-widget.active .chat-toggle-btn .chat-icon-main {
  display: none;
}

.floating-chat-widget.active .chat-toggle-btn .chat-icon-close {
  display: block !important;
  transform: rotate(90deg);
}

.chat-option {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.chat-option img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.chat-option.messenger:hover {
  transform: scale(1.1);
  background-color: #e0f2fe;
}

.chat-option.whatsapp:hover {
  transform: scale(1.1);
  background-color: #dcfce7;
}

.chat-option.instagram:hover {
  transform: scale(1.1);
  background-color: #fce7f3;
}

@media (max-width: 768px) {
  .floating-chat-widget {
    bottom: 20px;
    right: 20px;
  }

  .chat-toggle-btn {
    width: 40px;
    height: 40px;
  }

  .chat-toggle-btn .material-icons-round {
    font-size: 24px;
  }

  .chat-option {
    width: 40px;
    height: 40px;
  }

  .chat-option img {
    width: 20px;
    height: 20px;
  }
}