/**
 * pcard.css  — Altawfeer Product Card & Homepage Layout System
 * Version  : 4.0 FINAL (Clean & Scoped)
 * Scope    : .pcard, .hp-section, .hp-grid ONLY
 * Safe     : No global overrides, no !important on layout-breaking props
 * Loaded   : Last in <head> via app.blade.php for cascade priority
 */

/* ════════════════════════════════════════════════════════════
   SECTION 1 — PRODUCT CARD  (.pcard)
   Shared by: _feature-product, _product-card-1, _product-card-2
   ════════════════════════════════════════════════════════════ */

.pcard {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e8edf2;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.22s ease;
    box-sizing: border-box;
    /* height handled by content, NOT fixed */
}

.pcard:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
    border-color: #b2e0db;
}

/* ── Image Box ───────────────────────────────────────────── */
.pcard__img-box {
    position: relative;       /* anchor for absolute children */
    width: 100%;
    height: 200px;            /* fixed — reliable in OWL & grid */
    background: #f5f7fa;
    overflow: hidden;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f2f5;
}

.pcard__img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.pcard__img {
    max-width: 100%;
    max-height: 175px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    padding: 10px;
    transition: transform 0.32s ease;
    margin: auto;
}

.pcard:hover .pcard__img {
    transform: scale(1.05);
}

/* ── Badge (discount %) ──────────────────────────────────── */
.pcard__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    background: linear-gradient(135deg, #ff6b6b, #e53935);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 9px;
    border-radius: 100px;
    box-shadow: 0 2px 6px rgba(229,57,53,0.32);
    white-space: nowrap;
    pointer-events: none;
    display: inline-block;
    letter-spacing: 0.2px;
}

/* RTL: badge top-right = opposite side */
[dir="ltr"] .pcard__badge {
    right: auto;
    left: 10px;
}

/* ── Wishlist Heart ──────────────────────────────────────── */
.pcard__wish {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, color 0.16s ease, background 0.16s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    box-sizing: border-box;
    line-height: 0;
}

[dir="ltr"] .pcard__wish {
    left: auto;
    right: 10px;
}

.pcard__wish:hover {
    color: #e53935;
    background: #fff1f0;
    border-color: rgba(229,57,53,0.20);
    transform: scale(1.12);
}

/* ── Quick View Overlay (hidden → flex on hover) ─────────── */
.pcard__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    background: rgba(10,20,30,0.28);
    display: none;
    align-items: center;
    justify-content: center;
}

.pcard:hover .pcard__overlay {
    display: flex;
}

.pcard__qview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #00a65a;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 100px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease;
    border: none;
}

.pcard__qview:hover {
    background: #00a65a;
    color: #fff;
    text-decoration: none;
}

/* ── Out of Stock Ribbon ─────────────────────────────────── */
.pcard__oos {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    background: rgba(15,23,42,0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    padding: 8px;
    pointer-events: none;
    display: block;
}

/* ── Card Body ───────────────────────────────────────────── */
.pcard__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* ── Stars ───────────────────────────────────────────────── */
.pcard__stars {
    display: flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}

.pcard__stars .tio-star,
.pcard__stars .tio-star-half,
.pcard__stars .tio-star-outlined {
    font-size: 12px;
    color: #fbbf24;
}

.pcard__rcount {
    font-size: 11px;
    color: #9ca3af;
    margin-inline-start: 3px;
}

/* ── Product Name (2-line clamp) ────────────────────────── */
.pcard__name {
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1a2233;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    transition: color 0.16s ease;
    flex-grow: 1;
    min-height: 42px;  /* 2 lines × 14px × 1.5 lh */
}

.pcard__name:hover {
    color: #00a65a;
    text-decoration: none;
}

/* ── Prices ──────────────────────────────────────────────── */
.pcard__prices {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.pcard__price {
    font-size: 17px;
    font-weight: 900;
    color: #00a65a;
    line-height: 1;
    letter-spacing: -0.2px;
}

.pcard__old-price {
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: line-through;
    line-height: 1;
}

/* ── Add to Cart Button ──────────────────────────────────── */
.pcard__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    background: linear-gradient(135deg, #00a65a 0%, #007a42 100%);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 800;
    padding: 11px 16px;
    border-radius: 100px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 12px rgba(0,166,90,0.26);
    margin-top: auto;
    line-height: 1;
    box-sizing: border-box;
}

.pcard__btn:hover {
    background: linear-gradient(135deg, #007a42 0%, #005c32 100%);
    box-shadow: 0 7px 24px rgba(0,166,90,0.40);
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
}

.pcard__btn:active {
    transform: scale(0.98);
}

/* ── Inside OWL carousel ─────────────────────────────────── */
.owl-item .pcard {
    margin: 2px;
}

/* ════════════════════════════════════════════════════════════
   SECTION 2 — HOMEPAGE LAYOUT  (hp-* system)
   Scoped under .hp-section and .hp-wrapper
   ════════════════════════════════════════════════════════════ */

.hp-wrapper {
    background: #f2f5f8;
}

/* ── Section block ───────────────────────────────────────── */
.hp-section {
    padding: 36px 0;
    background: #f2f5f8;
}

.hp-section + .hp-section {
    border-top: 1px solid #e8ecf0;
}

.hp-section--accent {
    background: #eef9f5;
}

/* ── Section Header ──────────────────────────────────────── */
.hp-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.hp-section__title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hp-section__title {
    font-family: 'Cairo', sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: #1a2233;
    margin: 0;
    line-height: 1.2;
}

.hp-section__sub {
    font-size: 13px;
    color: #6b7a8d;
    margin: 0;
}

/* ── View All pill button ─────────────────────────────────── */
.hp-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #00a65a;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}

.hp-view-all:hover {
    background: #007a42;
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}

/* ── "New" badge ─────────────────────────────────────────── */
.hp-badge-new {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #00a65a, #007a42);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── 4-col CSS Grid (desktop/tablet) ─────────────────────── */
.hp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    align-items: stretch;
}

@media (max-width: 1199px) {
    .hp-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
}

@media (max-width: 991px) {
    .hp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 767px) {
    /* Hide grid on mobile — OWL carousel takes over */
    .hp-grid {
        display: none;
    }

    .hp-section {
        padding: 24px 0;
    }

    .hp-section__title {
        font-size: 18px;
    }

    .hp-section__head {
        margin-bottom: 16px;
    }
}

/* ── Mobile card tweaks ──────────────────────────────────── */
@media (max-width: 767px) {
    .pcard__img-box {
        height: 160px;
    }

    .pcard__body {
        padding: 12px 14px 14px;
        gap: 6px;
    }

    .pcard__price {
        font-size: 15px;
    }

    .pcard__btn {
        font-size: 13px;
        padding: 10px 12px;
    }

    .pcard__name {
        font-size: 13px;
        min-height: 39px;
    }
}

@media (max-width: 480px) {
    .pcard__img-box {
        height: 140px;
    }
}

/* ── OWL carousel mobile nav ─────────────────────────────── */
.hp-owl .owl-nav button.owl-prev,
.hp-owl .owl-nav button.owl-next {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.09);
    transition: background 0.16s ease;
}

.hp-owl .owl-nav button:hover {
    background: #00a65a;
    border-color: #00a65a;
    color: #fff;
}

.hp-owl .owl-item .pcard {
    height: 100%;
}

/* ════════════════════════════════════════════════════════════
   SECTION 3 — WIDGET CARDS (Best Sellers / Top Rated)
   at-widget-* classes from _best-selling.blade.php
   ════════════════════════════════════════════════════════════ */

.at-widget-card {
    background: #ffffff;
    border: 1px solid #e8edf2;
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
}

.at-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f3f6;
    gap: 8px;
}

.at-widget-icon {
    font-size: 20px;
}

.at-widget-title {
    font-family: 'Cairo', sans-serif;
    font-size: 17px;
    font-weight: 900;
    color: #1a2233;
    margin: 0;
    flex: 1;
}

.at-view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #00a65a;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.16s ease;
}

.at-view-all:hover {
    color: #007a42;
    text-decoration: none;
}

.at-view-all--sm {
    font-size: 12px;
}

.at-widget-list {
    display: flex;
    flex-direction: column;
}

.at-widget-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background 0.16s ease;
    border-bottom: 1px solid #f5f7fa;
}

.at-widget-item:last-child {
    border-bottom: none;
}

.at-widget-item:hover {
    background: #f5fdf9;
    text-decoration: none;
}

.at-widget-img-wrap {
    width: 56px;
    height: 56px;
    background: #f5f7fa;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.at-widget-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 4px;
}

.at-widget-info {
    flex: 1;
    overflow: hidden;
}

.at-widget-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a2233;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.at-widget-pricing {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.at-widget-price {
    font-size: 14px;
    font-weight: 800;
    color: #00a65a;
}

.at-widget-old-price {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}

.at-widget-badge {
    font-size: 10px;
    font-weight: 800;
    background: rgba(229,57,53,0.10);
    color: #e53935;
    padding: 2px 7px;
    border-radius: 100px;
}

.at-widget-stars {
    display: flex;
    gap: 2px;
    margin-top: 3px;
}

/* ════════════════════════════════════════════════════════════
   SECTION 4 — TRUST / RELIABILITY BAR  (at-trust-* system)
   Used by: _company-reliability.blade.php
   4 columns desktop — 2 columns tablet — 1 column mobile
   ════════════════════════════════════════════════════════════ */

.at-trust-section {
    background: #ffffff;
    border-top: 1px solid #edf0f4;
    border-bottom: 1px solid #edf0f4;
    padding: 28px 0;
    margin-top: 0;
}

/* 4-col grid */
.at-trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 991px) {
    .at-trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .at-trust-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ── Each card ───────────────────────────────────────────── */
.at-trust-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #f8fafb;
    border: 1px solid #e8edf2;
    border-radius: 14px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.18s ease;
    text-decoration: none;
}

.at-trust-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.08);
    border-color: #b2e0db;
}

/* ── Icon wrapper ────────────────────────────────────────── */
.at-trust-icon-wrap {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.at-trust-icon-wrap svg {
    width: 26px;
    height: 26px;
}

.at-trust-icon-wrap img.at-trust-custom-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* ── Per-card color theming ──────────────────────────────── */
.at-trust--delivery .at-trust-icon-wrap {
    background: rgba(0, 166, 90, 0.10);
    color: #00a65a;
}

.at-trust--payment .at-trust-icon-wrap {
    background: rgba(30, 120, 220, 0.10);
    color: #1e78dc;
}

.at-trust--original .at-trust-icon-wrap {
    background: rgba(245, 158, 11, 0.10);
    color: #d97706;
}

.at-trust--returns .at-trust-icon-wrap {
    background: rgba(139, 92, 246, 0.10);
    color: #7c3aed;
}

.at-trust--custom .at-trust-icon-wrap {
    background: rgba(42, 172, 160, 0.10);
    color: #2AACA0;
}

/* ── Text content ────────────────────────────────────────── */
.at-trust-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.at-trust-title {
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #1a2233;
    margin: 0;
    line-height: 1.3;
}

.at-trust-desc {
    font-size: 12px;
    color: #6b7a8d;
    margin: 0;
    line-height: 1.4;
}

