:root {
    /* Palette — sampled from the Kealy Sportswear garment specs.
       One purple only: --hero-bg. --purple is an accent, never a background. */
    --gold:        #F0C982;  /* Vegas Gold — garment spec */
    --gold-deep:   #A17735;  /* Vegas Gold Glitter — garment spec */
    /* Neither garment gold is readable as small text on white: --gold is
       1.57:1 and --gold-deep 4.03:1, both under the 4.5:1 AA floor. This is
       the same hue taken dark enough to pass (5.34:1) for the header tagline.
       On the purple hero, use --gold itself (10.53:1). */
    --gold-ink:    #8A6428;
    --purple:      #3F326E;  /* garment purple — accents only, too light for bg */
    --hero-bg:     #2A0061;  /* site purple — hero background, wordmark, buttons */
    --ink:         #000000;

    /* Neutral & Accents */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --border-color: #e5e7eb;

    /* Layout */
    --container-max-width: 1200px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--hero-bg);
    font-weight: 700;
}

/* Navbar — white bar, gold rule as the only separator before the hero */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 3px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* The mark reads as a crest: circular, ringed in gold, no rectangular border.
   logo.png ships with its own purple background baked in, so crop it to the
   circle with `cover` — letterboxing it with `contain` would show that
   rectangle floating inside a disc of a second, slightly different purple. */
.logo__mark {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background-color: var(--hero-bg);  /* only visible if the image fails */
    object-fit: cover;
    flex-shrink: 0;
}

.logo__name {
    font-family: Poppins, system-ui, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--hero-bg);
}

/* Letterspaced gold caps, so it reads as a lockup rather than a caption */
.logo__tag {
    display: block;
    font-family: Poppins, system-ui, sans-serif;
    font-size: 0.63rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.22em;
    text-indent: 0.22em;    /* offsets the trailing letter-space */
    text-transform: uppercase;
    color: var(--gold-ink);
    margin-top: 5px;
}

.cart-toggle {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    color: var(--hero-bg);
    transition: var(--transition);
    padding: 8px;
    border-radius: 50%;
}

.cart-toggle:hover {
    background-color: rgba(42, 0, 97, 0.05);
}

/* Purple disc, gold numeral — legible against the white bar */
.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--hero-bg);
    color: var(--gold);
    font-family: Poppins, system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    height: 20px;
    min-width: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(25%, -25%);
    border: 2px solid var(--card-bg);
}

/* Hero */
.hero {
  background: var(--hero-bg);
  padding: clamp(3rem, 9vw, 6rem) 1.25rem;
  text-align: center;
  overflow: hidden;              /* the rotated script can overhang */
}
.hero__inner { max-width: 60rem; margin-inline: auto; }

.hero__kicker {
  font-family: Poppins, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.7rem, 2.2vw, 0.95rem);
  letter-spacing: 0.3em;
  text-indent: 0.3em;            /* offsets the trailing letter-space */
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 clamp(0.75rem, 2vw, 1.25rem);
}

.hero__script {
  font-family: Yellowtail, cursive;
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 1.1;
  color: var(--gold);
  text-shadow: 0.05em 0.05em 0 var(--gold-deep);   /* em, so it scales */
  transform: rotate(-7deg);
  margin: 0;
  padding-bottom: 0.15em;        /* room for the descender on "g" */
}

.hero__tag {
  font-family: Poppins, system-ui, sans-serif;
  font-size: clamp(0.85rem, 2.4vw, 1rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 34ch;
  margin: clamp(0.75rem, 2vw, 1.25rem) auto 0;
}

/* Rotation eats horizontal room and forces the type down a size on phones. */
@media (max-width: 30rem) {
  .hero__script { transform: rotate(-4deg); }
}

/* Product Grid */
/* auto-fit, not auto-fill: empty tracks collapse, so a two-product store gets
   two equal full-width cards instead of two cards hugging the left of a
   four-column grid while the header and hero stay centred. */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 60px 0;
}

/* One product would otherwise stretch to the full container width. */
.product-grid:has(.product-card:only-child) {
    grid-template-columns: minmax(280px, 560px);
    justify-content: center;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.product-card:nth-child(2) {
    animation-delay: 0.1s;
}

/* Holds the grid's height while the catalog request is in flight, so arriving
   products swap in rather than pushing the page around. */
.product-card--placeholder {
    min-height: 480px;
    background-color: #f1f1f3;
    border-color: transparent;
    box-shadow: none;
    animation: placeholderPulse 1.4s ease-in-out infinite;
}

.product-card--placeholder:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

@keyframes placeholderPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    .product-card--placeholder {
        animation: none;
    }
}

/* Empty-store and fetch-failure messages sit in place of the cards */
.grid-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.grid-message--error {
    color: var(--text-main);
}

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

.product-image-container {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #f0f0f0;
    position: relative;
}

/* All of a product's images ship in the HTML; only the active one is shown. */
.product-image {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: var(--transition);
}

.product-image.is-active {
    display: block;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

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

.product-title {
    font-size: 1.125rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hero-bg);
    margin-bottom: 16px;
}

.product-options {
    margin-bottom: 16px;
    flex-grow: 1;
}

.size-selector {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: white;
    cursor: pointer;
}

.size-selector:focus {
    outline: none;
    border-color: var(--hero-bg);
    box-shadow: 0 0 0 2px rgba(42, 0, 97, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

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

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

.btn-secondary {
    background-color: #e5e7eb;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-block {
    width: 100%;
}

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

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

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

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

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

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

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

.close-cart:hover {
    color: var(--hero-bg);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-empty {
    text-align: center;
    color: var(--text-muted);
    margin-top: 40px;
}

.cart-item {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-right: 16px;
}

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

.cart-item-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.cart-item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

.cart-item-price {
    font-weight: 700;
    color: var(--hero-bg);
}

.remove-item {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.85rem;
    cursor: pointer;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--hero-bg);
    box-shadow: 0 0 0 2px rgba(42, 0, 97, 0.1);
}

.order-success {
    text-align: center;
    padding: 20px 0;
}

.order-success h3 {
    color: #10b981;
    margin-bottom: 10px;
}

.order-success p {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.hidden {
    display: none;
}

.mt-4 {
    margin-top: 16px;
}

.mt-auto {
    margin-top: auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Spam Prevention */
.honeypot {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    overflow: hidden;
}

/* Image Carousel Buttons */
.img-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--hero-bg);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.product-image-container:hover .img-btn {
    opacity: 1;
}

.img-btn:hover {
    background-color: var(--gold);
    color: var(--text-main);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}
