/*
 * Re-Classic (homepage_select = reclassic) — homepage & product card upgrade.
 * Only loaded when the Re-Classic skin is active (see frontend/layouts/app.blade.php).
 * Colours follow the admin-configured --primary / --secondary so the skin stays on-brand.
 */

:root {
    --rc-ink: #1f2430;
    --rc-muted: #6b7280;
    --rc-line: #e8eaef;
    --rc-surface: #ffffff;
    --rc-sunken: #f5f6f8;
    --rc-deal: #e53935;
    --rc-good: #16a34a;
    --rc-radius: 10px;
}

/* ---------- Product card ---------- */
.rc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--rc-surface);
    border: 1px solid transparent;
    border-radius: var(--rc-radius);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.rc-section .rc-card { border-color: var(--rc-line); }
.rc-card:hover { border-color: var(--primary); box-shadow: 0 8px 22px -12px rgba(31, 36, 48, .35); }

.rc-card__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--rc-sunken);
    overflow: hidden;
}
.rc-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.rc-card:hover .rc-card__media img { transform: scale(1.04); }

.rc-card__tags {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    pointer-events: none;
}
.rc-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
    background: var(--rc-ink);
}
.rc-tag--deal { background: var(--rc-deal); font-size: 12px; }
.rc-tag--free { background: var(--primary); }
.rc-tag--pre { background: #3490dc; }
.rc-tag--whole { background: #455a64; }

/* wishlist / compare stay as the theme's slide-in icons */
.rc-card .aiz-p-hov-icon { top: 4px; right: 4px; z-index: 2; }
.rc-card:hover .aiz-p-hov-icon a { transform: translateX(0); }

.rc-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 10px 12px 12px;
    text-align: left;
}
.rc-card__name {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    min-height: calc(13px * 1.4 * 2);
    color: var(--rc-ink);
}
.rc-card__name a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: inherit;
}
.rc-card__name a:hover { color: var(--primary); }

.rc-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 6px;
    margin-bottom: 6px;
}
.rc-price__now { font-size: 16px; font-weight: 700; color: var(--primary); }
.rc-price__was { font-size: 12px; color: var(--rc-muted); text-decoration: line-through; }

.rc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    min-height: 18px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--rc-muted);
}
.rc-meta__rating { color: var(--rc-ink); font-weight: 600; }
.rc-meta__rating i { color: #f5a623; font-size: 13px; margin-right: 2px; }
.rc-meta__sold + .rc-meta__sold,
.rc-meta__rating + .rc-meta__sold { padding-left: 8px; border-left: 1px solid var(--rc-line); }

.rc-perks { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.rc-perk {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--rc-good);
}
.rc-perk i { font-size: 13px; }
.rc-perk--hot { color: var(--rc-deal); }

.rc-card__cta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 36px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.rc-card__cta i { font-size: 18px; }
.rc-card__cta:hover,
.rc-card__cta:focus-visible,
.rc-card:hover .rc-card__cta { background: var(--primary); color: #fff; }
.rc-card__cta:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 575px) {
    .rc-card__body { padding: 8px 8px 10px; }
    .rc-price__now { font-size: 15px; }
    .rc-card__cta { height: 34px; font-size: 12px; }
}

/* ---------- Section shell ---------- */
.rc-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}
.rc-section__title { margin: 0; font-size: 20px; font-weight: 700; color: var(--rc-ink); }
.rc-section__sub { margin: 2px 0 0; font-size: 13px; color: var(--rc-muted); }
.rc-section__nav { display: flex; align-items: center; gap: 8px; }
.rc-section__nav .slide-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--rc-line);
    border-radius: 50%;
    background: #fff;
}
.rc-section__nav .slide-arrow:hover { border-color: var(--primary); color: var(--primary) !important; }
.rc-link-all { font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.rc-link-all:hover { text-decoration: underline; color: var(--primary); }
.rc-section .carousel-box { padding-top: 2px; padding-bottom: 2px; }
/* equal-height slides so every "Add to cart" button sits on the same line */
.rc-section .slick-track { display: flex !important; }
.rc-section .slick-slide { height: auto; }
.rc-section .slick-slide > div,
.rc-section .slick-slide .carousel-box { height: 100%; }
@media (max-width: 767px) {
    .rc-section__title { font-size: 17px; }
}

/* ---------- Service promises strip ---------- */
.rc-promises {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fff;
    border: 1px solid var(--rc-line);
    border-radius: var(--rc-radius);
}
.rc-promise {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--rc-ink);
}
.rc-promise + .rc-promise { border-left: 1px solid var(--rc-line); }
a.rc-promise:hover { color: var(--primary); }
.rc-promise__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--soft-primary, rgba(0, 0, 0, .05));
    color: var(--primary);
    font-size: 22px;
}
.rc-promise__title { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.rc-promise__text { display: block; font-size: 12px; color: var(--rc-muted); line-height: 1.4; }
@media (max-width: 991px) {
    .rc-promises { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rc-promise:nth-child(3) { border-left: 0; }
    .rc-promise:nth-child(n+3) { border-top: 1px solid var(--rc-line); }
}
@media (max-width: 575px) {
    .rc-promise { padding: 10px 12px; gap: 8px; }
    .rc-promise__icon { width: 32px; height: 32px; font-size: 18px; }
    .rc-promise__title { font-size: 12px; }
    .rc-promise__text { display: none; }
}

/* ---------- Today's deal rail ---------- */
.rc-deal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    color: var(--rc-ink);
}
.rc-deal-item:hover { color: var(--rc-ink); box-shadow: 0 0 0 1px var(--primary); }
.rc-deal-item__img { position: relative; flex: 0 0 72px; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; background: var(--rc-sunken); }
.rc-deal-item__img img { width: 100%; height: 100%; object-fit: cover; }
.rc-deal-item__img .rc-tag { position: absolute; top: 4px; left: 4px; padding: 0 4px; font-size: 10px; }
.rc-deal-item__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
    font-size: 12px;
    line-height: 1.35;
}
.rc-deal-item .rc-price { margin-bottom: 0; }
.rc-deal-item .rc-price__now { font-size: 14px; }
@media (max-width: 991px) {
    /* below lg the deal rail becomes one swipeable row instead of a tall grid */
    .rc-deal-rail { height: auto !important; overflow: hidden !important; }
    .rc-deal-rail > .row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .rc-deal-rail > .row::-webkit-scrollbar { display: none; }
    .rc-deal-rail > .row > .col { flex: 0 0 40%; max-width: 40%; scroll-snap-align: start; margin-bottom: 0 !important; }
    .rc-deal-item { flex-direction: column; align-items: stretch; text-align: left; }
    .rc-deal-item__img { flex-basis: auto; width: 100%; height: auto; aspect-ratio: 1 / 1; }
}
@media (min-width: 768px) and (max-width: 991px) {
    .rc-deal-rail > .row > .col { flex-basis: 24%; max-width: 24%; }
}

/* ---------- Flash sale ---------- */
.rc-flash-item {
    display: block;
    height: 100%;
    background: #fff;
    border-radius: var(--rc-radius);
    overflow: hidden;
    color: var(--rc-ink);
}
.rc-flash-item:hover { color: var(--rc-ink); box-shadow: 0 0 0 1px var(--rc-deal); }
.rc-flash-item .rc-card__media img { object-fit: cover; }
.rc-flash-item__body { padding: 8px 10px 12px; }
.rc-sold-bar {
    position: relative;
    height: 16px;
    margin-top: 6px;
    border-radius: 8px;
    background: #ffd7d5;
    overflow: hidden;
}
.rc-sold-bar__fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff7043, var(--rc-deal)); border-radius: 8px; }
.rc-sold-bar__text {
    position: relative;
    display: block;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 2px rgba(0, 0, 0, .35);
}

@media (prefers-reduced-motion: reduce) {
    .rc-card, .rc-card__media img, .rc-card__cta { transition: none; }
    .rc-card:hover .rc-card__media img { transform: none; }
}

/* ---------- Coupon banner ---------- */
.rc-coupon__title { font-size: 36px; }
.rc-coupon__sub { font-size: 20px; }
@media (max-width: 767px) {
    .rc-coupon__title { font-size: 24px; }
    .rc-coupon__sub { font-size: 15px; }
}

/* ---------- Small phones: give cards more room ---------- */
@media (max-width: 575px) {
    .rc-section.p-3 { padding: 12px 8px !important; }
    .rc-section .rc-section__head { padding: 0 4px; margin-bottom: 12px; }
    .rc-card__cta { white-space: nowrap; font-size: 12px; gap: 4px; }
    .rc-card__cta i { display: none; }
}

/* Track-order call-to-action in the desktop header */
.rc-track-btn {
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    margin-left: 20px;
    padding: 6px 18px 6px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary, #e62e04), #ff7a1a);
    color: #fff !important;
    box-shadow: 0 6px 16px -6px rgba(230, 46, 4, .6);
    white-space: nowrap;
    line-height: 1.15;
    transition: transform .2s ease, box-shadow .2s ease;
}
.rc-track-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(230, 46, 4, .7); color: #fff; }
.rc-track-btn__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: var(--primary, #e62e04);
    font-size: 22px;
}
.rc-track-btn__icon::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .8);
    animation: rc-track-ping 2s ease-out infinite;
}
.rc-track-btn__text strong { display: block; font-size: 14px; font-weight: 700; }
.rc-track-btn__text small { display: block; font-size: 11px; opacity: .9; }
@keyframes rc-track-ping {
    0% { transform: scale(1); opacity: .9; }
    80%, 100% { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .rc-track-btn__icon::after { animation: none; } }

/* Product description: one font, full-width stacked images (marketplace style) */
.rc-desc { font-size: 15px; line-height: 1.75; color: #1f2937; max-width: 900px; margin: 0 auto; }
.rc-desc * { font-family: inherit !important; }
.rc-desc p { margin: 0 0 .9em; }
.rc-desc h2 { font-size: 19px; font-weight: 700; margin: 1.4em 0 .6em; }
.rc-desc h3 { font-size: 16px; font-weight: 700; margin: 1.2em 0 .5em; }
.rc-desc h4 { font-size: 15px; font-weight: 700; margin: 1em 0 .4em; }
.rc-desc ul, .rc-desc ol { padding-left: 1.3em; margin: 0 0 .9em; }
.rc-desc li { margin-bottom: .3em; }
.rc-desc img { display: block; width: 100% !important; max-width: 100% !important; height: auto !important; float: none !important; margin: 0; border-radius: 0; }
.rc-desc p:has(> img:only-child) { margin: 0 0 4px; }
.rc-desc video { display: block; width: 100%; max-height: 80vh; background: #000; margin: 0 0 8px; }
.rc-desc .rc-desc-table { overflow-x: auto; margin: 0 0 1em; }
.rc-desc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rc-desc td, .rc-desc th { border: 1px solid #e5e7eb; padding: 8px 10px; vertical-align: top; }
.rc-desc tr td:first-child { background: #f9fafb; font-weight: 600; width: 38%; }
.rc-desc blockquote { padding: 10px 14px; border-left: 3px solid var(--primary); background: #fff7ed; margin: 0 0 1em; }
.rc-desc a { color: var(--primary); text-decoration: underline; }

/* ---------- Home: product video (reels) rail ---------- */
.rc-reel { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--rc-surface); border: 1px solid var(--rc-line); border-radius: var(--rc-radius); overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease; }
.rc-reel:hover { border-color: var(--primary); box-shadow: 0 8px 22px -12px rgba(31, 36, 48, .35); }
.rc-reel__media { position: relative; display: block; aspect-ratio: 9 / 16; background: #111; overflow: hidden; color: #fff; }
.rc-reel__media:hover, .rc-reel__media:focus { color: #fff; }
.rc-reel__poster, .rc-reel__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rc-reel__poster { transition: opacity .3s ease, transform .35s ease; }
.rc-reel__video { opacity: 0; transition: opacity .3s ease; }
.rc-reel.is-playing .rc-reel__video { opacity: 1; }
.rc-reel.is-playing .rc-reel__poster { opacity: 0; }
.rc-reel:hover .rc-reel__poster { transform: scale(1.04); }
.rc-reel__media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); pointer-events: none; }
.rc-reel__play { position: absolute; top: 50%; left: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(0, 0, 0, .45); font-size: 24px; transition: opacity .2s ease, transform .2s ease; }
.rc-reel.is-playing .rc-reel__play { opacity: 0; transform: scale(.8); }
.rc-reel__dur { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .6); font-size: 11px; font-weight: 600; }
.rc-reel__info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 10px; }
.rc-reel__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 600; line-height: 1.35; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.rc-reel__views { display: flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 11px; opacity: .85; }
.rc-reel__views i { font-size: 14px; }
.rc-reel__product { display: flex; align-items: center; gap: 8px; padding: 8px; color: var(--rc-ink); border-top: 1px solid var(--rc-line); }
.rc-reel__product:hover { color: var(--primary); }
.rc-reel__product img { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 6px; object-fit: cover; background: var(--rc-sunken); }
.rc-reel__product-body { min-width: 0; flex: 1 1 auto; line-height: 1.3; }
.rc-reel__product-name { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.rc-reel__product-price { display: block; font-size: 13px; font-weight: 700; color: var(--rc-deal); }
.rc-reel__product-cta { flex: 0 0 auto; font-size: 18px; color: var(--primary); }
@media (prefers-reduced-motion: reduce) { .rc-reel__poster, .rc-reel__video, .rc-reel__play { transition: none; } }
.rc-reel__watch-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 6px; background: var(--rc-sunken); color: var(--primary); font-size: 18px; }
.rc-reel__watch { display: block; font-size: 13px; font-weight: 700; color: var(--primary); }
.rc-reel__media.is-noposter { background: linear-gradient(160deg, #2b2f3a, #111); }
.rc-reels-skeleton { height: 520px; background: linear-gradient(90deg, var(--rc-sunken) 0%, #eceef2 50%, var(--rc-sunken) 100%); background-size: 200% 100%; animation: rc-skel 1.4s ease-in-out infinite; }
@keyframes rc-skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 767px) { .rc-reels-skeleton { height: 420px; } }
@media (prefers-reduced-motion: reduce) { .rc-reels-skeleton { animation: none; } }
