/* Explain: Styles for UI components, including product cards and buttons. */
.wordmark {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-color);
    line-height: 1;
}

.wordmark--footer {
    font-size: 1.15rem;
    color: var(--secondary-color);
}

.nav-link {
    position: relative;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 1px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-link:hover { color: var(--secondary-hover); }
.nav-link:hover::after { width: 100%; }

.nav-link.is-active { color: var(--secondary-hover); }
.nav-link.is-active::after { width: 100%; }

.mobile-link {
    display: block;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.mobile-link:last-of-type { border-bottom: 0; }

.mobile-link.is-active { color: var(--secondary-hover); }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s ease;
}

.icon-btn:hover { color: var(--secondary-hover); }

.badge-count {
    position: absolute;
    top: 0.2rem;
    right: 0.15rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding-inline: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--secondary-color);
    color: #241f16;
    font-size: 0.62rem;
    font-weight: 600;
}

.btn-gold,
.btn-navy,
.btn-outline-navy,
.btn-outline-ivory {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.95rem 1.9rem;
    border-radius: 2px;
    border: 1px solid transparent;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-navy {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #f8f5f0;
}

.btn-navy:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #241f16;
}

.btn-gold {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #241f16;
}

.btn-gold:hover {
    background: var(--secondary-hover);
    border-color: var(--secondary-hover);
    color: #fff;
}

.btn-outline-navy {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-navy:hover {
    background: var(--primary-color);
    color: #f8f5f0;
}

.btn-outline-ivory {
    border-color: rgba(248, 245, 240, 0.65);
    color: #f8f5f0;
    background: transparent;
}

.btn-outline-ivory:hover {
    background: #f8f5f0;
    color: var(--primary-color);
}

.eyebrow {
    font-size: 0.67rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--secondary-hover);
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

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

.product-media {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--surface-color);
}

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

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

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.25rem 1.25rem 1.5rem;
}

.product-cat {
    font-size: 0.62rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.product-name {
    margin-top: 0.4rem;
    font-size: 1.25rem;
}

.product-price {
    margin-top: 0.35rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-color);
}

.product-link {
    margin-top: auto;
    padding-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--secondary-hover);
}

/* Collections listing: equal-height rows with bottom-aligned price + Add to Bag.
   Scoped to [data-cat] grids so the homepage featured grid (.product-grid) is untouched. */
[data-cat] .product-card {
    height: 100%;
}

[data-cat] .product-body {
    display: flex;
    flex-direction: column;
}

[data-cat] .product-price {
    margin-top: auto;
}

/* "Complete the look" (product-detail related grid): reuse the Collections
   card-alignment approach — equal-height rows with bottom-aligned price and
   Add to Bag. Scoped to [data-related] so other product grids are untouched. */
[data-related] .product-card {
    height: 100%;
}

[data-related] .product-body {
    display: flex;
    flex-direction: column;
}

[data-related] .product-price {
    margin-top: auto;
}

.collection-tile { display: block; }

.collection-frame {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

.collection-name {
    margin-top: 0.9rem;
    font-size: 1.15rem;
}

.collection-tag {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    height: 100%;
    padding: 1rem;
    text-align: center;
    background: var(--surface-color);
    color: var(--text-muted);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.media-placeholder i {
    font-size: 1.4rem;
    color: var(--secondary-color);
}

.media-placeholder span {
    max-width: 14rem;
    line-height: 1.6;
}

.step-item {
    padding: 1.75rem 1.5rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
}

.step-number {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--secondary-hover);
}

.field-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.field-input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: #fff;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.field-input:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.field-input::placeholder { color: #a9a29a; }

.detail-media {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--surface-color);
}

.detail-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-thumb {
    width: 5rem;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-thumb.is-active { border-color: var(--secondary-color); }

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    background: #fff;
}

.qty-control button {
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s ease;
}

.qty-control button:hover { color: var(--secondary-hover); }

.qty-control input,
.qty-value {
    width: 3rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    text-align: center;
    background: transparent;
    font-size: 0.95rem;
    -moz-appearance: textfield;
}

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

.qty-control--sm button { width: 2.1rem; height: 2.1rem; }
.qty-control--sm input,
.qty-control--sm .qty-value { width: 2.4rem; height: 2.1rem; }

.checkout-card {
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    padding: 1.75rem;
}

.cart-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.35rem 0;
}

.cart-thumb {
    width: 5rem;
    height: 6rem;
    flex: none;
    object-fit: cover;
    background: var(--surface-color);
}

.cart-info { flex: 1 1 12rem; min-width: 0; }

.cart-name {
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}

.cart-unit {
    margin-top: 0.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cart-line {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-left: auto;
}

.cart-remove {
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.app-toast {
    position: fixed;
    left: 50%;
    bottom: 1.75rem;
    transform: translate(-50%, 1.5rem);
    z-index: 80;
    padding: 0.85rem 1.5rem;
    background: var(--primary-color);
    color: #f8f5f0;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.form-status {
    margin-top: 1rem;
    font-size: 0.85rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--secondary-color);
    background: rgba(179, 147, 85, 0.12);
    color: var(--text-color);
}

.form-status.is-error {
    border-color: #b4453c;
    background: rgba(180, 69, 60, 0.08);
    color: #8d3630;
}

.footer-head {
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--secondary-color);
    font-family: var(--font-body);
}

.footer-link {
    display: inline-block;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #b8b2a6;
    transition: color 0.3s ease;
}

.footer-link:hover { color: #fff; }

.footer-link--sm { font-size: 0.8rem; }

.social-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(248, 245, 240, 0.25);
    color: #d9d1c2;
    transition: all 0.3s ease;
}

.social-dot:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* Temporary migration pilot activity log */
.pilot-log {
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.65;
    color: #cbc4b8;
    background: var(--surface-deep);
}

.pilot-log-line {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pilot-log-line--ok { color: #8fd694; }
.pilot-log-line--warn { color: #e0b96a; }
.pilot-log-line--error { color: #e08a82; }

/* Product detail (mobile) — horizontal overflow fix.
   The detail grid columns default to `min-width: auto`, so a single
   unbreakable run of characters (a long product title token, SKU, or dense
   label) stretches its column past the viewport and the whole page scrolls
   sideways. Let the columns shrink and allow long product text to wrap onto
   its own line instead of pushing the layout wider. Nothing is hidden or
   truncated — the text simply wraps. */
.product-detail-grid,
.product-detail-grid > *,
[data-related],
[data-related] > * {
    min-width: 0;
}

.detail-title,
.detail-sku,
[data-related] .product-name a {
    overflow-wrap: anywhere;
}