/* =========================================================
   Home page (resources/views/frontpage/index.blade.php)
   Kept as a static file (not inline) so browsers cache it
   instead of re-downloading it inside every page view.
   ========================================================= */
:root {
    --rx-primary: #0071bb;
    --rx-primary-dark: #005a96;
    --rx-secondary: #0ea5e9;
    --rx-accent: #f59e0b;
    --rx-success: #10b981;
    --rx-danger: #ef4444;
    --rx-dark: #0f172a;
    --rx-muted: #64748b;
    --rx-border: #e2e8f0;
    --rx-radius: 16px;
    --rx-shadow: 0 10px 25px -5px rgba(0, 113, 187, .08), 0 8px 10px -6px rgba(0, 0, 0, .04);
    --rx-shadow-hover: 0 20px 30px -10px rgba(0, 113, 187, .18), 0 10px 15px -5px rgba(0, 0, 0, .08);
}

/* style.css sets html{font-size:62.5%} (1rem=10px) site-wide; reset it here so
   this page's rem-based sizing means what it says (1rem=16px). */
html { font-size: 100%; }

body.rx-home {
    font-family: 'Jost', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #334155;
    overflow-x: hidden;
    font-size: 16px;
}

.rx-home a:focus-visible,
.rx-home button:focus-visible {
    outline: 3px solid rgba(14, 165, 233, .6);
    outline-offset: 2px;
}

.rx-section-block { margin-bottom: 48px; }

.rx-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.rx-section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--rx-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.25;
}
.rx-section-sub { color: var(--rx-muted); font-size: .95rem; margin: 4px 0 0; }
.rx-section-link {
    font-weight: 700;
    color: var(--rx-primary);
    white-space: nowrap;
    text-decoration: none;
}
.rx-section-link:hover { color: var(--rx-primary-dark); text-decoration: underline; }

/* ---------------- Hero ---------------- */
.rx-hero-wrapper { position: relative; margin-bottom: 24px; }

.rx-hero-slide {
    min-height: 460px;
    border-radius: var(--rx-radius);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 40px 48px 40px 64px;
    color: #fff;
    box-shadow: var(--rx-shadow);
}
.rx-hero-slide.slide-blue   { background: linear-gradient(135deg, #0f172a 0%, #0071bb 60%, #0ea5e9 100%); }
.rx-hero-slide.slide-green  { background: linear-gradient(135deg, #064e3b 0%, #047857 60%, #10b981 100%); }
.rx-hero-slide.slide-purple { background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 60%, #8b5cf6 100%); }
.rx-hero-slide.slide-orange { background: linear-gradient(135deg, #7c2d12 0%, #c2410c 60%, #f97316 100%); }
.rx-hero-slide.slide-amber  { background: linear-gradient(135deg, #78350f 0%, #b45309 60%, #f59e0b 100%); }
.rx-hero-slide.slide-slate  { background: linear-gradient(135deg, #111827 0%, #1f2937 60%, #4b5563 100%); }

.rx-hero-content { max-width: 560px; z-index: 2; position: relative; }

.rx-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rx-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .3);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.rx-hero-tag.is-ok   { background: rgba(16, 185, 129, .9); border-color: transparent; }
.rx-hero-tag.is-bad  { background: rgba(239, 68, 68, .9); border-color: transparent; }
.rx-hero-tag.is-rx   { background: #fde68a; color: #78350f; border-color: transparent; }

.rx-hero-title {
    font-size: 2.9rem;
    font-weight: 900;
    line-height: 1.12;
    color: #fff !important;
    margin: 0 0 14px;
    letter-spacing: -.02em;
}
.rx-hero-desc {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, .92);
    margin-bottom: 22px;
    line-height: 1.6;
    font-weight: 500;
}
.rx-hero-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.rx-hero-price-now { font-size: 2rem; font-weight: 800; }
.rx-hero-price-old { font-size: 1.1rem; opacity: .7; text-decoration: line-through; }
.rx-hero-save { background: #ef4444; border-radius: 30px; padding: 2px 12px; font-weight: 700; font-size: .95rem; }

.rx-hero-features { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.rx-hero-feat-chip {
    background: rgba(255, 255, 255, .15);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rx-hero-btn-group { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.rx-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--rx-dark);
    font-weight: 800;
    font-size: 1.05rem;
    padding: 14px 28px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .15);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    cursor: pointer;
}
.rx-hero-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0, 0, 0, .25); color: var(--rx-primary); text-decoration: none; }
.rx-hero-btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .45); box-shadow: none; }
.rx-hero-btn-ghost:hover { background: #fff; color: var(--rx-dark); }

.rx-hero-img-wrap {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    width: 38%;
    max-width: 420px;
    z-index: 1;
    display: flex;
    justify-content: center;
}
.rx-hero-img-wrap.is-product {
    background: rgba(255, 255, 255, .95);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35);
    max-width: 340px;
}
.rx-hero-img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    border-radius: 16px;
}
.rx-hero-img-wrap.is-product .rx-hero-img { max-height: 280px; }

/* Owl: same look for every carousel on the page */
.rx-home .owl-carousel .owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    padding: 0 6px;
    margin: 0;
}
.rx-home .owl-carousel .owl-nav button.owl-prev,
.rx-home .owl-carousel .owl-nav button.owl-next {
    pointer-events: auto;
    width: 42px;
    height: 42px;
    border-radius: 50% !important;
    background: #fff !important;
    color: var(--rx-dark) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 1px solid var(--rx-border) !important;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.rx-home .owl-carousel .owl-nav button.owl-prev:hover,
.rx-home .owl-carousel .owl-nav button.owl-next:hover {
    background: var(--rx-primary) !important;
    color: #fff !important;
    border-color: var(--rx-primary) !important;
}
.rx-home .owl-carousel .owl-nav button.disabled { opacity: 0; pointer-events: none; }
.rx-home .rx-product-carousel .owl-nav { left: -14px; width: calc(100% + 28px); top: 40%; }
.rx-home .owl-carousel .owl-dots { text-align: center; margin-top: 14px; }
.rx-home .owl-carousel .owl-dots .owl-dot span {
    width: 10px; height: 10px; margin: 0 4px;
    background: #cbd5e1; display: inline-block; border-radius: 20px;
    transition: width .25s ease, background .25s ease;
}
.rx-home .owl-carousel .owl-dots .owl-dot.active span { width: 28px; background: var(--rx-primary); }
#heroCarousel .owl-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); margin: 0; z-index: 10; }
#heroCarousel .owl-dots .owl-dot span { background: rgba(255, 255, 255, .45); }
#heroCarousel .owl-dots .owl-dot.active span { background: #fff; }
#heroCarousel .owl-nav { padding: 0 14px; }
/* Product rows: let card shadows show and keep equal heights */
.rx-product-carousel .owl-stage-outer { padding: 8px 2px 18px; margin: -8px -2px -18px; }
.rx-product-carousel .owl-stage { display: flex; }
.rx-product-carousel .owl-item { display: flex; }
.rx-product-carousel .owl-item > * { width: 100%; }

/* Before Owl finishes loading, show slides in a simple scroll row (no stacked tower / layout jump) */
.rx-home .owl-carousel:not(.owl-loaded) { display: flex; overflow: hidden; gap: 18px; }
.rx-home .owl-carousel:not(.owl-loaded) > * { flex: 0 0 auto; }
#heroCarousel:not(.owl-loaded) > * { width: 100%; }
#heroCarousel:not(.owl-loaded) > *:not(:first-child) { display: none; }
.rx-product-carousel:not(.owl-loaded) > * { width: 220px; }

/* ---------------- Trust bar ---------------- */
.rx-trust {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 40px;
}
.rx-trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--rx-border);
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--rx-dark);
    text-decoration: none;
}
a.rx-trust-item:hover { border-color: var(--rx-primary); text-decoration: none; color: var(--rx-dark); }
.rx-trust-icon {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(0, 113, 187, .1);
    color: var(--rx-primary);
}
.rx-trust-item strong { display: block; font-size: 1rem; line-height: 1.25; }
.rx-trust-item span { display: block; font-size: .85rem; color: var(--rx-muted); line-height: 1.35; }

/* ---------------- Categories ---------------- */
.rx-cat-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 4px 2px 12px;
    scrollbar-width: thin;
}
.rx-cat-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--rx-border);
    border-radius: 999px;
    padding: 6px 18px 6px 6px;
    font-weight: 600;
    color: var(--rx-dark);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.rx-cat-chip:hover { border-color: var(--rx-primary); color: var(--rx-primary); box-shadow: var(--rx-shadow); text-decoration: none; }
.rx-cat-chip img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #f1f5f9;
}
.rx-cat-chip.is-all { padding: 6px 18px; background: var(--rx-primary); border-color: var(--rx-primary); color: #fff; }
.rx-cat-chip.is-all:hover { background: var(--rx-primary-dark); color: #fff; }

/* ---------------- Product cards ---------------- */
.rx-product-card {
    background: #fff;
    border-radius: var(--rx-radius);
    border: 1px solid var(--rx-border);
    box-shadow: var(--rx-shadow);
    padding: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease, border-color .3s ease;
}
.rx-product-card:hover { transform: translateY(-4px); box-shadow: var(--rx-shadow-hover); border-color: rgba(0, 113, 187, .3); }

.rx-card-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    height: 190px;
    margin-bottom: 12px;
}
.rx-home .rx-card-thumb img {
    width: auto;
    max-width: 100%;
    max-height: 170px;
    height: auto;
    object-fit: contain;
    transition: transform .4s ease, opacity .35s ease;
}
.rx-card-thumb .rx-img-hover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}
.rx-card-thumb .rx-img-hover:not([src]) { display: none; }
@media (hover: hover) {
    .rx-product-card:hover .rx-card-thumb .rx-img-hover[src] { opacity: 1; }
    .rx-product-card.has-hover-img:hover .rx-img-primary { opacity: 0; }
    .rx-product-card:hover .rx-card-thumb img.rx-img-primary { transform: scale(1.05); }
}

.rx-card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    z-index: 2;
}
.rx-badge-pill {
    font-size: .72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .4px;
    line-height: 1.2;
}
.rx-badge-outstock { background: #fee2e2; color: #b91c1c; }
.rx-badge-rx       { background: #fef3c7; color: #92400e; }
.rx-badge-sale     { background: #ef4444; color: #fff; }
.rx-badge-top      { background: #dcfce7; color: #15803d; }

.rx-card-body { display: flex; flex-direction: column; flex-grow: 1; }
.rx-product-cat {
    font-size: .75rem;
    color: var(--rx-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rx-home .rx-product-title {
    font-size: 1.02rem !important;
    font-weight: 700;
    color: var(--rx-dark);
    margin: 0 0 4px;
    line-height: 1.35 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
.rx-product-title a { color: inherit; text-decoration: none; }
.rx-product-title a:hover { color: var(--rx-primary); }
.rx-product-generic {
    font-size: .82rem;
    color: var(--rx-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.rx-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--rx-border);
}
.rx-price { display: flex; flex-direction: column; min-width: 0; }
.rx-price-current { font-size: 1.05rem; font-weight: 800; color: var(--rx-primary); white-space: nowrap; }
.rx-price-old { font-size: .8rem; color: #94a3b8; text-decoration: line-through; white-space: nowrap; }

.rx-btn-cart {
    background: var(--rx-primary);
    color: #fff;
    border: none;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transition: background .2s ease, transform .1s ease;
}
.rx-btn-cart:hover { background: var(--rx-primary-dark); }
.rx-btn-cart:active { transform: scale(.97); }
.rx-is-loading { opacity: .65; pointer-events: none; cursor: progress; }

/* ---------------- Insurance ---------------- */
.rx-insurance-section {
    background: #fff;
    border-radius: var(--rx-radius);
    padding: 24px 28px;
    margin-bottom: 48px;
    border: 1px solid var(--rx-border);
    box-shadow: var(--rx-shadow);
}
.rx-insurance-card {
    background: #f8fafc;
    border: 1px solid var(--rx-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    transition: border-color .2s ease, background .2s ease;
}
.rx-insurance-card:hover { background: #fff; border-color: var(--rx-primary); }
.rx-home .rx-insurance-card img { max-height: 66px; max-width: 150px; width: auto; object-fit: contain; }

/* ---------------- Prescription CTA ---------------- */
.rx-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #0f172a 0%, #0071bb 100%);
    color: #fff;
    border-radius: var(--rx-radius);
    padding: 32px 36px;
    margin-bottom: 48px;
    box-shadow: var(--rx-shadow);
}
.rx-cta h2 { color: #fff; font-size: 1.7rem; font-weight: 800; margin: 0 0 6px; }
.rx-cta p { margin: 0; color: rgba(255, 255, 255, .85); font-size: 1.02rem; }
.rx-cta-steps { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; padding: 0; list-style: none; }
.rx-cta-steps li { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; }
.rx-cta-steps b {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem;
}

/* ---------------- Reviews ---------------- */
.rx-review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rx-review-card {
    background: #fff;
    border: 1px solid var(--rx-border);
    border-radius: var(--rx-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rx-review-stars { color: #f59e0b; font-size: .95rem; letter-spacing: 2px; }
.rx-review-text { color: #334155; font-size: .98rem; line-height: 1.6; margin: 0; flex-grow: 1; }
.rx-review-who { font-weight: 700; color: var(--rx-dark); font-size: .92rem; }
.rx-review-who span { color: var(--rx-muted); font-weight: 500; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1199.98px) {
    .rx-trust { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991.98px) {
    .rx-hero-slide { min-height: 420px; padding: 36px 32px; }
    .rx-hero-title { font-size: 2.1rem; }
    .rx-hero-img-wrap { right: 24px; width: 34%; }
    .rx-review-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767.98px) {
    .rx-hero-slide {
        min-height: 0;
        padding: 28px 20px 48px;
        flex-direction: column;
        text-align: center;
    }
    .rx-hero-content { max-width: 100%; }
    .rx-hero-tags, .rx-hero-features, .rx-hero-btn-group, .rx-hero-price { justify-content: center; }
    .rx-hero-title { font-size: 1.65rem; }
    .rx-hero-desc { font-size: 1rem; }
    .rx-hero-features { display: none; }
    .rx-hero-btn { padding: 12px 20px; font-size: .98rem; }
    .rx-hero-img-wrap {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 220px;
        margin: 20px auto 0;
        order: -1;
    }
    .rx-hero-img-wrap.is-product { padding: 14px; max-width: 180px; }
    .rx-hero-img { max-height: 180px; }
    .rx-hero-img-wrap.is-product .rx-hero-img { max-height: 150px; }

    .rx-section-title { font-size: 1.25rem; }
    .rx-section-block { margin-bottom: 36px; }
    .rx-trust { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 28px; }
    .rx-trust-item { padding: 10px; gap: 8px; flex-direction: column; text-align: center; }
    .rx-trust-icon { flex-basis: auto; width: 38px; height: 38px; font-size: 1rem; }
    .rx-trust-item span { display: none; }
    .rx-trust-item strong { font-size: .88rem; }

    .rx-card-thumb { height: 150px; }
    .rx-home .rx-card-thumb img { max-height: 135px; }
    .rx-product-card { padding: 10px; }
    .rx-card-footer { flex-direction: column; align-items: stretch; }
    .rx-btn-cart { justify-content: center; }
    .rx-home .rx-product-carousel .owl-nav { display: none; }

    .rx-cta { padding: 24px 20px; }
    .rx-cta h2 { font-size: 1.35rem; }
    .rx-review-grid { grid-template-columns: 1fr; }
    .rx-insurance-section { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .rx-product-card, .rx-card-thumb img, .rx-hero-btn { transition: none; }
}
