/* =============================================================================
   Foundation styles for reusable crackers-website components.
   These ADD styling for new components only. They do NOT override the existing
   template design system (css/style.css). Colours use CSS variables so each
   company can be re-themed from one place / from admin later.
   ============================================================================= */

:root {
    --brand-primary: #7a0000;
    --brand-accent: #ff0000;
    --brand-badge: #b01e1e;
    --brand-on-primary: #ffffff;
}

/* ---- Product card --------------------------------------------------------- */
.product-card {
    border-radius: 10px;
    transition: transform .18s ease, box-shadow .18s ease;
    background: #fff;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .12);
}
.product-card__img {
    height: 150px;
    object-fit: contain;
}
.product-card__badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}
.product-card__badges .badge {
    font-size: 11px;
    letter-spacing: .3px;
}
.offer-badge {
    background: var(--brand-accent);
}
.product-card__code {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--brand-badge);
    color: var(--brand-on-primary);
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 12px;
    z-index: 2;
}
.product-card__tamil {
    font-size: 13px;
}
.product-card .strike {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    font-size: 14px;
}

/* ---- Quantity control ----------------------------------------------------- */
.qty-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    overflow: hidden;
}
.qty-btn {
    border: 0;
    background: #f3f3f3;
    width: 34px;
    height: 34px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.qty-btn:hover {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
}
.qty-input {
    width: 54px;
    height: 34px;
    border: 0;
    text-align: center;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---- Category card -------------------------------------------------------- */
.category-card__img {
    height: 90px;
    object-fit: contain;
}

/* ---- Category heading band (reused by product_grid grouped mode) ---------- */
.category-bg {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 10px;
    border-radius: 6px;
    font-size: 20px;
}

/* ---- Search / filter bar -------------------------------------------------- */
.search-filter-bar {
    background: #fff;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    top: 0;
    z-index: 20;
    margin-bottom: 10px;
}
.search-filter-bar__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}
.search-filter-bar .js-product-search {
    padding-left: 34px;
}

/* ---- Enquiry floating action button --------------------------------------- */
.enquiry-fab {
    position: fixed;
    right: 18px;
    bottom: 150px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    font-size: 22px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    z-index: 1050;
    cursor: pointer;
}
.enquiry-fab__count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--brand-accent);
    color: #fff;
    font-size: 12px;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    border-radius: 11px;
    padding: 0 6px;
    border: 2px solid #fff;
}

/* ---- Enquiry drawer ------------------------------------------------------- */
.enquiry-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 380px;
    max-width: 90vw;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, .2);
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 1060;
    display: flex;
    flex-direction: column;
}
.enquiry-drawer.is-open {
    transform: translateX(0);
}
.enquiry-drawer__header {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.enquiry-drawer__close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.enquiry-drawer__body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}
.enquiry-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 1055;
}
.enquiry-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.enquiry-totals {
    border-top: 1px dashed #ddd;
    margin-top: 12px;
    padding-top: 12px;
}
.enquiry-totals > div {
    padding: 3px 0;
}

/* ---- Cart line item ------------------------------------------------------- */
.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cart-item__img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex: 0 0 44px;
}
.cart-item__body {
    flex: 1;
    min-width: 0;
}
.cart-item__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}
.cart-item__meta {
    font-size: 12px;
    color: #666;
}
.cart-item__qty {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cart-item__qty button {
    width: 26px;
    height: 26px;
    border: 1px solid #ccc;
    background: #fafafa;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
}
.cart-item__qty input {
    width: 42px;
    height: 26px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.cart-item__remove {
    background: none;
    border: 0;
    color: #c00;
    cursor: pointer;
    font-size: 18px;
}

/* ---- Hidden state helper for filtered cards ------------------------------- */
.product-card-col.is-hidden {
    display: none !important;
}

@media (max-width: 575px) {
    .enquiry-fab {
        bottom: 130px;
        right: 12px;
    }
}
