/* ==========================================================
   SHOPOCROP DESIGN SYSTEM
   Global tokens, typography, utilities, and component styles.
   Load this after Bootstrap but before any page-level CSS.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* ----------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------- */
:root {
    /* Brand Colors */
    --color-primary:      #1B5E20;
    --color-primary-dark: #145218;
    --color-accent:       #2E7D32;
    --color-accent-light: #43A047;

    /* Backgrounds & Surfaces */
    --color-bg:      #F9F9F9;
    --color-surface: #FFFFFF;
    --color-surface-2: #F4F4F4; /* nested/muted panels (light grey fills) */

    /* Text */
    --color-text:       #333333;
    --color-text-muted: #666666;
    --color-text-white: #FFFFFF;

    /* Borders & Dividers */
    --color-border:    #E0E0E0;
    --color-table-alt: #F4F8F4;

    /* Status Colors */
    --color-stock-ok:  #2E7D32;
    --color-stock-low: #E65100;
    --color-stock-nil: #C62828;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body:    'Source Sans 3', 'Inter', system-ui, sans-serif;

    /* Type Scale */
    --text-h1:    clamp(32px, 5vw, 40px);
    --text-h2:    28px;
    --text-h3:    24px;
    --text-price: 18px;
    --text-body:  16px;
    --text-label: 14px;

    /* Spacing */
    --radius-card:  12px;
    --radius-btn:   8px;
    --radius-badge: 20px;

    /* Shadows */
    --shadow-card:       0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 8px 32px rgba(27, 94, 32, 0.15);
    --shadow-btn:        0 2px 8px rgba(27, 94, 32, 0.30);
}

/* ----------------------------------------------------------
   2. BASE TYPOGRAPHY HELPERS
   ---------------------------------------------------------- */
.sc-h1 {
    font-family: var(--font-heading);
    font-size: var(--text-h1);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
    margin: 0;
}

.sc-h2 {
    font-family: var(--font-heading);
    font-size: var(--text-h2);
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.3;
    margin: 0;
}

.sc-h3 {
    font-family: var(--font-heading);
    font-size: var(--text-h3);
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.35;
    margin: 0;
}

.sc-body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    color: var(--color-text);
    line-height: 1.6;
}

.sc-label {
    font-family: var(--font-body);
    font-size: var(--text-label);
    font-weight: 600;
    color: var(--color-text-muted);
}

/* ----------------------------------------------------------
   3. UTILITY CLASSES
   ---------------------------------------------------------- */

/* Primary filled button */
.btn-shopocrop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 28px;
    min-height: 48px;
    background-color: var(--color-primary);
    color: var(--color-text-white);
    font-family: var(--font-body);
    font-size: var(--text-label);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-btn);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-shopocrop:hover,
.btn-shopocrop:focus-visible {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: var(--shadow-btn);
    transform: translateY(-1px);
    color: var(--color-text-white);
    text-decoration: none;
}

.btn-shopocrop:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Outline variant */
.btn-shopocrop-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 28px;
    min-height: 48px;
    background-color: transparent;
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: var(--text-label);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-btn);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-shopocrop-outline:hover,
.btn-shopocrop-outline:focus-visible {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Accent badge */
.badge-shopocrop {
    display: inline-block;
    padding: 3px 10px;
    background-color: var(--color-accent);
    color: var(--color-text-white);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: var(--radius-badge);
}

/* Section header block */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header .section-header__title {
    font-family: var(--font-heading);
    font-size: var(--text-h2);
    font-weight: 600;
    color: var(--color-primary);
    margin: 0 0 8px;
}

.section-header .section-header__subtitle {
    font-family: var(--font-body);
    font-size: var(--text-body);
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Price tag */
.price-tag {
    font-family: var(--font-body);
    font-size: var(--text-price);
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
}

.price-tag .price-tag__original {
    font-size: var(--text-label);
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: line-through;
    margin-left: 6px;
}

/* ----------------------------------------------------------
   4. HERO BANNER COMPONENT
   ---------------------------------------------------------- */
.sc-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #0d2b12;
}

.sc-hero__aspect {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
}

.sc-hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sc-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.30) 50%,
        rgba(0, 0, 0, 0.10) 100%
    );
}

.sc-hero__caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 7%;
    max-width: 660px;
}

.sc-hero__eyebrow {
    font-family: var(--font-body);
    font-size: var(--text-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 14px;
}

.sc-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(28px, 4.5vw, 44px);
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: 16px;
}

.sc-hero__subtitle {
    font-family: var(--font-body);
    font-size: var(--text-body);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 460px;
}

.sc-hero__cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media (max-width: 767px) {
    .sc-hero__aspect {
        padding-top: 70%;
    }

    .sc-hero__caption {
        padding: 0 5%;
        max-width: 100%;
        justify-content: flex-end;
        padding-bottom: 8%;
    }

    .sc-hero__eyebrow {
        font-size: 11px;
        letter-spacing: 2px;
        margin-bottom: 10px;
    }

    .sc-hero__subtitle {
        display: none;
    }

    .sc-hero__cta-row {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .sc-hero__aspect {
        padding-top: 85%;
    }
}

/* ----------------------------------------------------------
   5. PRODUCT CARD GRID COMPONENT
   ---------------------------------------------------------- */
.sc-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1199px) {
    .sc-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .sc-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 400px) {
    .sc-product-grid {
        grid-template-columns: 1fr;
    }
}

.sc-product-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.sc-product-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
}

.sc-product-card__image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: var(--color-table-alt);
}

.sc-product-card__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.sc-product-card:hover .sc-product-card__image-wrap img {
    transform: scale(1.04);
}

.sc-product-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
}

.sc-product-card__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.sc-product-card__name {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-product-card__rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    font-size: var(--text-label);
    color: var(--color-text-muted);
}

.sc-product-card__stars {
    color: #F9A825;
    font-size: 13px;
    letter-spacing: 1px;
}

.sc-product-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.sc-product-card__footer .btn-shopocrop {
    padding: 9px 16px;
    min-height: 40px;
    font-size: 12px;
    letter-spacing: 1.5px;
    flex: 1;
    min-width: 0;
}

/* ----------------------------------------------------------
   6. ADMIN PRODUCTS TABLE COMPONENT
   ---------------------------------------------------------- */
.shopocrop-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    background-color: var(--color-surface);
}

.shopocrop-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: var(--text-body);
    color: var(--color-text);
}

.shopocrop-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--color-primary);
}

.shopocrop-table thead th {
    padding: 14px 16px;
    font-size: var(--text-label);
    font-weight: 700;
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.92);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    border: none;
    text-align: left;
}

.shopocrop-table thead th.text-end {
    text-align: right;
}

.shopocrop-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s ease;
}

.shopocrop-table tbody tr:last-child {
    border-bottom: none;
}

.shopocrop-table tbody tr:nth-child(even) {
    background-color: var(--color-table-alt);
}

.shopocrop-table tbody tr:hover {
    background-color: #EBF5EC;
}

.shopocrop-table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: var(--text-body);
    border: none;
}

.shopocrop-table tbody td.text-end {
    text-align: right;
}

.sc-table-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    display: block;
}

.sc-table-product-name {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
}

.sc-table-product-category {
    font-size: var(--text-label);
    color: var(--color-text-muted);
    margin-top: 2px;
}

.sc-table-price {
    font-family: 'Courier New', Courier, monospace;
    font-size: var(--text-body);
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}

.sc-stock-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-badge);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-body);
    white-space: nowrap;
}

.sc-stock-badge--ok {
    background-color: #E8F5E9;
    color: var(--color-stock-ok);
}

.sc-stock-badge--low {
    background-color: #FFF3E0;
    color: var(--color-stock-low);
}

.sc-stock-badge--nil {
    background-color: #FFEBEE;
    color: var(--color-stock-nil);
}

.sc-table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.sc-table-actions .btn {
    padding: 5px 12px;
    font-size: 13px;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 6px;
}
