/* Djernes MX - Main Stylesheet */
/* Brand: Blue #2b2d9e, Red #e63030, White #ffffff */

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

:root {
  --color-blue: #2b2d9e;
  --color-blue-dark: #1e2080;
  --color-red: #e63030;
  --color-red-dark: #c41f1f;
  --color-white: #ffffff;
  --color-bg: #f4f4f6;
  --color-text: #1a1a1a;
  --color-muted: #666;
  --color-border: #ddd;
  --color-card-bg: #ffffff;
  --color-success: #2e7d32;
  --color-error: #c62828;

  --font-heading: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', Arial, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;

  --radius: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Base */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Header */
.site-header {
  background: var(--color-blue);
  padding: var(--space-md) 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.site-logo img {
  height: 60px;
  width: auto;
}

.site-logo-text {
  display: flex;
  flex-direction: column;
}

.site-logo-text .brand-name {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: 1px;
  line-height: 1;
}

.site-logo-text .brand-name span {
  color: var(--color-red);
}

.site-logo-text .brand-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Cart icon in header */
.cart-btn {
  background: var(--color-red);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  transition: background 0.2s;
  white-space: nowrap;
}

.cart-btn:hover {
  background: var(--color-red-dark);
}

.cart-count {
  background: var(--color-white);
  color: var(--color-red);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Hero banner */
.hero {
  background: linear-gradient(135deg, var(--color-blue) 60%, var(--color-blue-dark) 100%);
  color: var(--color-white);
  padding: var(--space-xl) 0;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.1;
}

.hero h1 span {
  color: var(--color-red);
}

.hero p {
  margin-top: var(--space-sm);
  font-size: 1.1rem;
  opacity: 0.85;
}

/* Section titles */
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-blue);
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-red);
  display: inline-block;
  margin-bottom: var(--space-lg);
}

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

.section-alt {
  background: #eceef8;
}

/* Offer card */
.offer-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 4px solid var(--color-red);
}

.offer-card-header {
  background: var(--color-blue);
  color: var(--color-white);
  padding: var(--space-md) var(--space-lg);
}

.offer-card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.offer-card-header .offer-dates {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 2px;
}

.offer-card-body {
  padding: var(--space-lg);
}

.offer-desc {
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
  font-size: 0.95rem;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.product-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.product-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f0f0f0;
}

.product-card-img-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #e8e8f0, #d0d0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 2.5rem;
}

.product-card-body {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}

.product-card-desc {
  font-size: 0.82rem;
  color: var(--color-muted);
  flex: 1;
  margin-bottom: var(--space-sm);
}

.product-card-price {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-red);
  margin-bottom: var(--space-sm);
}

/* Quantity row on product card */
.card-qty-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-qty-minus,
.card-qty-plus {
  background: var(--color-bg);
  border: none;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-qty-minus:hover,
.card-qty-plus:hover {
  background: var(--color-border);
}

.card-qty-input {
  flex: 1;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  height: 36px;
  padding: 0;
  color: var(--color-text);
  background: var(--color-white);
  -moz-appearance: textfield;
}

.card-qty-input::-webkit-outer-spin-button,
.card-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.card-qty-input:focus {
  outline: none;
  background: #f0f2ff;
}

.add-to-cart-btn {
  background: var(--color-blue);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem;
  width: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.add-to-cart-btn:hover {
  background: var(--color-blue-dark);
}

.add-to-cart-btn.added {
  background: var(--color-success);
}

/* Offers section layout */
.offers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

/* Cart Sidebar */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
}

.cart-overlay.open {
  display: block;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -480px;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--color-white);
  z-index: 300;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.cart-header {
  background: var(--color-blue);
  color: var(--color-white);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.cart-close-btn {
  background: transparent;
  border: none;
  color: var(--color-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
}

.cart-item-price {
  color: var(--color-muted);
  font-size: 0.85rem;
  min-width: 70px;
  text-align: right;
}

.cart-qty-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-btn:hover {
  background: var(--color-border);
}

.cart-qty-num {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
}

.cart-remove-btn {
  background: transparent;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

.cart-remove-btn:hover {
  color: var(--color-red);
}

.cart-empty-msg {
  text-align: center;
  color: var(--color-muted);
  padding: var(--space-xl) 0;
  font-size: 0.95rem;
}

.cart-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 2px solid var(--color-border);
  background: #fafafa;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.cart-total-price {
  color: var(--color-red);
  font-size: 1.3rem;
}

.btn-checkout {
  background: var(--color-red);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem;
  width: 100%;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.5px;
}

.btn-checkout:hover {
  background: var(--color-red-dark);
}

/* Checkout modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal-overlay.open {
  display: flex;
}

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

.modal-header {
  background: var(--color-blue);
  color: var(--color-white);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-body {
  padding: var(--space-lg);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text);
}

.form-group label .required {
  color: var(--color-red);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(43, 45, 158, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-sm);
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.btn-primary {
  background: var(--color-red);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem var(--space-lg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  transition: background 0.2s;
}

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

.btn-secondary {
  background: transparent;
  color: var(--color-blue);
  border: 2px solid var(--color-blue);
  border-radius: var(--radius);
  padding: 0.75rem var(--space-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--color-blue);
  color: var(--color-white);
}

/* Success message */
.success-msg {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.success-msg .checkmark {
  font-size: 4rem;
  margin-bottom: var(--space-md);
}

.success-msg h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--color-success);
  margin-bottom: var(--space-sm);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-blue);
  color: var(--color-white);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 500;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* No offers message */
.no-content {
  text-align: center;
  color: var(--color-muted);
  padding: var(--space-lg) 0;
  font-style: italic;
}

/* Footer */
.site-footer {
  background: #1a1a1a;
  color: #aaa;
  padding: var(--space-lg) 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer p+p {
  margin-top: var(--space-xs);
}

.site-footer a {
  color: #ccc;
}

/* Responsive */
@media (min-width: 768px) {
  .offers-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 480px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .brand-name {
    font-size: 1.6rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}