/* ============================
   Petite Boutique — Styles
   ============================ */

:root {
  --color-primary: #2c2c2c;
  --color-primary-light: #4a4a4a;
  --color-accent: #b8860b;
  --color-accent-light: #d4a843;
  --color-accent-dark: #8b6914;
  --color-bg: #faf9f7;
  --color-bg-alt: #f3f1ed;
  --color-white: #ffffff;
  --color-text: #2c2c2c;
  --color-text-light: #6b6b6b;
  --color-text-muted: #999999;
  --color-border: #e8e5e0;
  --color-border-light: #f0ede8;
  --color-danger: #c0392b;
  --color-danger-light: #e74c3c;
  --color-success: #27ae60;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================
   Header
   ============================ */
.header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-primary);
}

.logo-icon {
  font-size: 20px;
  color: var(--color-accent);
}

.logo-icon.large {
  font-size: 32px;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--color-text-light);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--color-text);
  background: var(--color-bg-alt);
}

.nav-link.active {
  color: var(--color-accent-dark);
  background: rgba(184, 134, 11, 0.08);
}

/* ============================
   Hero
   ============================ */
.hero {
  background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  color: var(--color-white);
  padding: 80px 0;
  text-align: center;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -1px;
  margin-bottom: 16px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.65);
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto;
}

/* ============================
   Main Content
   ============================ */
.main {
  padding: 60px 0 80px;
  min-height: 50vh;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.section-desc {
  font-size: 16px;
  color: var(--color-text-light);
  font-weight: 300;
}

/* ============================
   Articles Grid
   ============================ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.article-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--color-border-light);
}

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

.article-card-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  background: var(--color-bg-alt);
  display: block;
}

.article-card-image-placeholder {
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--color-text-muted);
}

.article-card-body {
  padding: 20px;
}

.article-card-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.article-card-desc {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-price {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-accent-dark);
}

/* ============================
   Loading
   ============================ */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
  grid-column: 1 / -1;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 15px;
}

/* ============================
   Footer
   ============================ */
.footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.8);
  padding: 48px 0 24px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 24px;
}

.footer-brand .logo-text {
  color: var(--color-white);
}

.footer-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin-top: 8px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

/* ============================
   Buttons
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

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

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-text-light);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
}

.btn-danger:hover {
  background: var(--color-danger-light);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================
   Admin — Login
   ============================ */
.admin-login {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  margin-top: 12px;
  margin-bottom: 6px;
}

.login-header p {
  font-size: 14px;
  color: var(--color-text-light);
}

/* ============================
   Forms
   ============================ */
.form-group {
  margin-bottom: 20px;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-text);
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-error {
  background: rgba(192, 57, 43, 0.08);
  color: var(--color-danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ============================
   Admin — Dashboard
   ============================ */
.admin-dashboard {
  padding: 40px 0 60px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
}

.dashboard-header h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
}

.dashboard-header p {
  font-size: 14px;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ============================
   Admin Table
   ============================ */
.admin-table-wrapper {
  background: var(--color-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.admin-table thead {
  background: var(--color-bg-alt);
}

.admin-table th {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.admin-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: rgba(184, 134, 11, 0.02);
}

.table-image {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-bg-alt);
}

.table-image-placeholder {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-text-muted);
}

.table-name {
  font-weight: 500;
  color: var(--color-primary);
}

.table-desc {
  color: var(--color-text-light);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-price {
  font-weight: 600;
  color: var(--color-accent-dark);
}

.table-date {
  color: var(--color-text-muted);
  font-size: 13px;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--color-text-light);
}

.btn-icon:hover {
  border-color: var(--color-text-light);
  color: var(--color-text);
}

.btn-icon.danger:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: rgba(192, 57, 43, 0.05);
}

.loading-cell {
  text-align: center;
  padding: 40px !important;
  color: var(--color-text-muted);
}

/* ============================
   Modal
   ============================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.modal-body-text {
  font-size: 15px;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ============================
   Toast Notification
   ============================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-danger);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
  .hero {
    padding: 50px 0;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }

  .article-card-image,
  .article-card-image-placeholder {
    height: 220px;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-table-wrapper {
    overflow-x: auto;
  }

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

  .login-card {
    padding: 28px;
  }

  .modal-content {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .header .container {
    height: 60px;
  }

  .logo-text {
    font-size: 18px;
  }

  .hero-title {
    font-size: 28px;
  }

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

  .container {
    padding: 0 16px;
  }
}
