/**
 * Nectarium Shop – Frontend Styles
 *
 * Brand tokens:
 *   Primary (amber/honey): #D4920B
 *   Primary dark:          #B37A09
 *   Text:                  #2C2416
 *   Background cream:      #FBF7F0
 *   Surface white:         #FFFFFF
 *   Border:                #E8DFD1
 *   Font heading:          'Playfair Display', serif
 *   Font body:             'DM Sans', sans-serif
 */

:root {
    --nec-color-primary:   #D4920B;
    --nec-color-primary-d: #B37A09;
    --nec-color-text:      #2C2416;
    --nec-color-text-soft: #6B5D4D;
    --nec-color-bg:        #FBF7F0;
    --nec-color-surface:   #FFFFFF;
    --nec-color-border:    #E8DFD1;
    --nec-color-success:   #5A8A3C;
    --nec-color-error:     #C0392B;
    --nec-radius:          8px;
    --nec-shadow:          0 2px 8px rgba(44, 36, 22, 0.08);
    --nec-transition:      0.2s ease;
}

/* ── Product Grid ─────────────────────────────────────────────────────────── */

.nec-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

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

.nec-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(44, 36, 22, 0.12);
}

.nec-product-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--nec-color-bg);
}

.nec-product-card__body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nec-product-card__name {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--nec-color-text);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.nec-product-card__name a {
    color: inherit;
    text-decoration: none;
}

.nec-product-card__name a:hover {
    color: var(--nec-color-primary);
}

.nec-product-card__description {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--nec-color-text-soft);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nec-product-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--nec-color-border);
}

.nec-product-card__price {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--nec-color-primary-d);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.nec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--nec-radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--nec-transition), transform var(--nec-transition);
    text-decoration: none;
    line-height: 1;
}

.nec-btn--primary {
    background: var(--nec-color-primary);
    color: #fff;
}

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

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

.nec-btn--secondary:hover {
    background: var(--nec-color-bg);
}

.nec-btn--large {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

.nec-add-to-cart {
    composes: nec-btn nec-btn--primary;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.nec-add-to-cart.nec-loading {
    opacity: 0.7;
    cursor: wait;
}

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

.nec-add-to-cart.nec-error {
    background: var(--nec-color-error);
}

/* ── Product Detail ───────────────────────────────────────────────────────── */

.nec-product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem 0;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .nec-product-detail {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.nec-product-detail__gallery img {
    width: 100%;
    border-radius: var(--nec-radius);
    object-fit: cover;
}

.nec-product-detail__info h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--nec-color-text);
    margin: 0 0 0.5rem;
}

.nec-product-detail__price {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--nec-color-primary-d);
    margin-bottom: 1.5rem;
}

.nec-product-detail__description {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--nec-color-text-soft);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.nec-product-detail__actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nec-quantity-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--nec-color-border);
    border-radius: var(--nec-radius);
    font-size: 1rem;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
}

/* ── Cart Badge (Header) ──────────────────────────────────────────────────── */

.nec-cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    color: var(--nec-color-text);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
}

.nec-cart-count {
    background: var(--nec-color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 50%;
    min-width: 1.2rem;
    text-align: center;
    line-height: 1.3;
}

.nec-cart-count--empty {
    display: none;
}

/* ── Mini-Cart Flyout ─────────────────────────────────────────────────────── */

.nec-minicart-flyout {
    position: fixed;
    top: 1rem;
    right: -400px;
    width: 360px;
    max-height: 80vh;
    background: var(--nec-color-surface);
    border: 1px solid var(--nec-color-border);
    border-radius: var(--nec-radius);
    box-shadow: 0 8px 32px rgba(44, 36, 22, 0.15);
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
    font-family: 'DM Sans', sans-serif;
}

.nec-minicart-flyout--visible {
    right: 1rem;
}

.nec-minicart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid var(--nec-color-border);
}

.nec-minicart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--nec-color-text-soft);
    line-height: 1;
}

.nec-minicart-items {
    padding: 0.75rem 1.25rem;
}

.nec-minicart-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--nec-color-border);
}

.nec-minicart-item:last-child {
    border-bottom: none;
}

.nec-minicart-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.nec-minicart-item-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.nec-minicart-item-qty {
    font-size: 0.85rem;
    color: var(--nec-color-text-soft);
}

.nec-minicart-total {
    padding: 0.75rem 1.25rem;
    font-size: 1.1rem;
    border-top: 1px solid var(--nec-color-border);
}

.nec-minicart-checkout {
    margin: 0.75rem 1.25rem 1.25rem;
    width: calc(100% - 2.5rem);
}

/* ── Cart Page ────────────────────────────────────────────────────────────── */

.nec-cart-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'DM Sans', sans-serif;
    margin-bottom: 2rem;
}

.nec-cart-table th {
    text-align: left;
    font-size: 0.85rem;
    color: var(--nec-color-text-soft);
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid var(--nec-color-border);
}

.nec-cart-row td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--nec-color-border);
    vertical-align: middle;
}

.nec-cart-cell--image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.nec-cart-cell--name {
    font-weight: 600;
}

.nec-cart-cell--quantity {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

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

.nec-qty-input {
    width: 45px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--nec-color-border);
    border-radius: 4px;
    font-size: 0.9rem;
}

.nec-remove-item {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--nec-color-text-soft);
    cursor: pointer;
}

.nec-remove-item:hover {
    color: var(--nec-color-error);
}

/* Cart Summary */

.nec-cart-summary {
    max-width: 400px;
    margin-left: auto;
    padding: 1.5rem;
    background: var(--nec-color-bg);
    border-radius: var(--nec-radius);
}

.nec-cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--nec-color-text-soft);
}

.nec-cart-summary-total {
    font-size: 1.15rem;
    color: var(--nec-color-text);
    border-top: 2px solid var(--nec-color-border);
    padding-top: 0.75rem;
    margin: 0.75rem 0 1.5rem;
}

/* ── Cart Empty ───────────────────────────────────────────────────────────── */

.nec-cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--nec-color-text-soft);
}

.nec-cart-empty p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */

.nec-loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--nec-color-text-soft);
    font-family: 'DM Sans', sans-serif;
}

.nec-error {
    color: var(--nec-color-error);
    font-family: 'DM Sans', sans-serif;
}

@media (max-width: 600px) {
    .nec-product-grid {
        grid-template-columns: 1fr;
    }

    .nec-cart-table th:nth-child(3),
    .nec-cart-row td:nth-child(3) {
        display: none;
    }
}
