/**
 * GRR Frontend Mini-site Styles
 *
 * Standalone styles for domain-based landing pages.
 * Uses CSS custom properties set inline from admin config.
 */

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

:root {
    --fe-primary: #3B5DA7;
    --fe-primary-dark: color-mix(in srgb, var(--fe-primary), black 15%);
    --fe-primary-light: color-mix(in srgb, var(--fe-primary), white 90%);
    --fe-text: #1f2937;
    --fe-text-light: #6b7280;
    --fe-bg: #f8f9fb;
    --fe-card-bg: #ffffff;
    --fe-border: #e5e7eb;
    --fe-radius: 16px;
    --fe-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --fe-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--fe-text);
    background: var(--fe-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------
 * Header
 * ------------------------------------------------------------- */

.grr-fe-header {
    background: var(--fe-primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.grr-fe-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    min-height: 60px;
    gap: 24px;
}

.grr-fe-logo {
    flex-shrink: 0;
}

.grr-fe-logo img {
    height: 80px;
    width: auto;
    display: block;
}

.grr-fe-nav {
    flex: 1;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.grr-fe-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.15s;
}

.grr-fe-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.grr-fe-nav .grr-fe-external::after {
    content: ' \2197';
    font-size: 0.75em;
}

.grr-fe-cart-summary {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.grr-fe-cart-icon {
    font-size: 1.125rem;
    color: #fff;
}

/* ---------------------------------------------------------------
 * Page Heading
 * ------------------------------------------------------------- */

.grr-fe-page-heading {
    text-align: center;
    padding: 32px 24px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.grr-fe-page-heading h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--fe-primary);
    line-height: 1.2;
    margin: 0;
}

/* ---------------------------------------------------------------
 * Content Areas (above / below products)
 * ------------------------------------------------------------- */

.grr-fe-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.grr-fe-content-above {
    padding-top: 0;
    padding-bottom: 16px;
}

.grr-fe-content-below {
    padding-top: 0;
    padding-bottom: 24px;
}

.grr-fe-content-inner {
    background: var(--fe-card-bg);
    border-radius: var(--fe-radius);
    padding: 24px 32px;
    box-shadow: var(--fe-shadow);
    color: var(--fe-text);
    line-height: 1.7;
}

.grr-fe-content-inner h1,
.grr-fe-content-inner h2,
.grr-fe-content-inner h3 {
    color: var(--fe-primary);
    margin-top: 0;
    margin-bottom: 0.5em;
    font-weight: 700;
}

.grr-fe-content-inner h1 { font-size: 1.75rem; }
.grr-fe-content-inner h2 { font-size: 1.375rem; }
.grr-fe-content-inner h3 { font-size: 1.125rem; }

.grr-fe-content-inner p {
    margin-bottom: 1em;
}

.grr-fe-content-inner p:last-child {
    margin-bottom: 0;
}

.grr-fe-content-inner a {
    color: var(--fe-primary);
    text-decoration: underline;
}

.grr-fe-content-inner ul,
.grr-fe-content-inner ol {
    margin: 0 0 1em 1.5em;
}

.grr-fe-content-inner img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ---------------------------------------------------------------
 * Product Grid
 * ------------------------------------------------------------- */

.grr-fe-products {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 24px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.grr-fe-product {
    background: var(--fe-card-bg);
    border-radius: var(--fe-radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--fe-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grr-fe-product:hover {
    box-shadow: var(--fe-shadow-hover);
    transform: translateY(-2px);
}

.grr-fe-product-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fe-text);
    margin-bottom: 12px;
    line-height: 1.3;
}

.grr-fe-product-image {
    width: 100%;
    aspect-ratio: 1;
    max-width: 280px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grr-fe-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Bottom section: price + qty + subtotal, pushed to bottom of card */
.grr-fe-product-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.grr-fe-product-desc {
    font-size: 0.875rem;
    color: var(--fe-text-light);
    margin-bottom: 12px;
    line-height: 1.4;
}

.grr-fe-product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fe-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.grr-fe-price-ex-gst {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--fe-text-light);
    margin-top: 2px;
}

/* Qty stepper */
.grr-fe-qty {
    display: flex;
    align-items: center;
    gap: 0;
}

.grr-fe-qty-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--fe-primary);
    background: transparent;
    color: var(--fe-primary);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    user-select: none;
}

.grr-fe-qty-btn:first-child {
    border-radius: 10px 0 0 10px;
}

.grr-fe-qty-btn:last-child {
    border-radius: 0 10px 10px 0;
}

.grr-fe-qty-btn:hover {
    background: var(--fe-primary);
    color: #fff;
}

.grr-fe-qty-btn:active {
    transform: scale(0.95);
}

.grr-fe-qty-value {
    width: 64px;
    height: 44px;
    border: none;
    border-top: 2px solid var(--fe-primary);
    border-bottom: 2px solid var(--fe-primary);
    border-radius: 0;
    text-align: center;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fe-text);
    background: var(--fe-card-bg);
    -moz-appearance: textfield;
    outline: none;
}

.grr-fe-qty-value::-webkit-outer-spin-button,
.grr-fe-qty-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.grr-fe-product-subtotal {
    margin-top: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fe-text-light);
    min-height: 1.2em;
}

.grr-fe-product-oos {
    font-size: 0.875rem;
    color: #dc2626;
    font-weight: 600;
    padding: 10px 0;
}

/* ---------------------------------------------------------------
 * Sticky Checkout Bar
 * ------------------------------------------------------------- */

.grr-fe-checkout-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--fe-card-bg);
    border-top: 2px solid var(--fe-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 99;
}

.grr-fe-combo-hint {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    text-align: center;
    padding: 8px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    border-bottom: 1px solid #a7f3d0;
}

.grr-fe-combo-hint i {
    margin-right: 4px;
    color: #059669;
}

.grr-fe-checkout-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.grr-fe-checkout-summary {
    font-size: 1rem;
    color: var(--fe-text-light);
}

.grr-fe-checkout-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fe-text);
    margin-left: 8px;
}

.grr-fe-checkout-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.grr-fe-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.2;
}

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

.grr-fe-btn-primary:hover {
    background: var(--fe-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.grr-fe-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.grr-fe-btn-secondary {
    background: transparent;
    color: var(--fe-primary);
    border: 2px solid var(--fe-border);
}

.grr-fe-btn-secondary:hover {
    border-color: var(--fe-primary);
}

/* ---------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------- */

.grr-fe-footer {
    text-align: center;
    padding: 24px 24px 100px;
    color: var(--fe-text-light);
    font-size: 0.8125rem;
    background: var(--fe-bg);
}

.grr-fe-footer a {
    color: var(--fe-primary);
    text-decoration: none;
}

.grr-fe-footer a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------- */

@media (max-width: 768px) {
    .grr-fe-header-inner {
        padding: 0 16px;
        gap: 12px;
    }

    .grr-fe-nav {
        display: none;
    }

    .grr-fe-page-heading {
        padding: 24px 16px 12px;
    }

    .grr-fe-page-heading h1 {
        font-size: 1.5rem;
    }

    .grr-fe-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .grr-fe-content-inner {
        padding: 20px;
    }

    .grr-fe-products {
        padding: 8px 16px 16px;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .grr-fe-checkout-inner {
        flex-direction: column;
        text-align: center;
        padding: 12px 16px;
        gap: 10px;
    }

    .grr-fe-checkout-actions {
        width: 100%;
    }

    .grr-fe-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 20px;
    }
}
