/* =========================
   Embed360 — Pure CSS (Scoped)
   ========================= */

/* Design tokens (override via inline style on .e360) */
.e360 {
    --brand: #f17288;
    --text: #363636;
    --text-muted: #6b7280; /* neutral-500-ish */
    --bg: #ffffff;
    --bg-soft: #f7f7f7;
    --bg-muted: #f0f0f0;
    --border: #e5e7eb; /* neutral-200-ish */
    --border-strong: #dfdfdf;
    --link: #2563eb; /* blue-600-ish */
    --danger: #d7443e;
}

/* Contained reset inside the namespace */

.e360 {
    z-index: 1;
    display: block;
    position: relative;
}

.e360,
.e360 * {
    box-sizing: border-box;
}
.e360 a {
    color: inherit;
    text-decoration: none !important;
}
.e360 img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================
   Utilities (scoped)
   ========================= */
.e360 .u-flex {
    display: flex;
}
.e360 .u-center {
    display: grid;
    place-items: center;
}
.e360 .u-hide {
    display: none !important;
}
.e360 .u-right {
    margin-left: auto;
}
.e360 .u-mb-0 {
    margin-bottom: 0;
}
.e360 .u-mb-2 {
    margin-bottom: 0.5rem;
}
.e360 .u-mb-3 {
    margin-bottom: 0.75rem;
}
.e360 .u-mb-4 {
    margin-bottom: 1rem;
}
.e360 .u-mt-2 {
    margin-top: 0.5rem;
}
.e360 .u-mt-3 {
    margin-top: 0.75rem;
}
.e360 .u-mt-4 {
    margin-top: 1rem;
}
.e360 .u-p-4 {
    padding: 1rem;
}
.e360 .u-px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}
.e360 .u-py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.e360 .u-rounded {
    border-radius: 0.5rem;
}
.e360 .u-rounded-full {
    border-radius: 9999px;
}
.e360 .u-text-sm {
    font-size: 1rem;
    line-height: 1.25rem;
}
.e360 .u-text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}
.e360 .u-text-muted {
    color: var(--text-muted);
}

/* =========================
   Links & Buttons
   ========================= */
.e360 .btn {
    display: inline-block;
    padding: 0.5rem 2rem;
    /* background: #edf0f2; */
    color: #2c3f4c;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
    border: 2px solid #2c3f4c;
}
.e360 .btn:hover {
    background: #e3e7ea;
}

/* Fancy brand button with glow */
.e360 .fancy-button {
    text-decoration: none !important;
    -webkit-transition: 0.1s all ease;
    transition: 0.1s ease all;
    position: relative;
    display: inline-block;
    width: 270px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    padding: 14px 0;
    border: 2px solid var(--brand);
    color: var(--brand);
    border-radius: 9999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 0;
}
.e360 .fancy-button:before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--brand);
    opacity: 0;
    z-index: -1;
    border-radius: 9999px;
    -webkit-transition: 0.2s all ease !important;
    transition: 0.2s all ease !important;
}
.e360 .fancy-button:hover,
.e360 .fancy-button:focus {
    color: #fff;
}
.e360 .fancy-button:hover:before,
.e360 .fancy-button:focus:before {
    opacity: 1;
}

/* =========================
   Layout
   ========================= */
.e360 .split {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.e360 .split .col {
    flex: 1 1 0;
}
.e360 .split .col.right {
    /* margin-left: 1.5rem; */
}

.e360 .sidebar {
    min-width: 220px;
}
@media (min-width: 768px) {
    .e360 .split .col.right {
        max-width: 240px;
    }
    .e360 .sidebar {
        padding-left: 1rem;
        border-left: 1px solid var(--border);
    }
}

@media (max-width: 640px) {
    .e360 .split {
        flex-direction: column;
    }
    .e360 .split .col.right {
        margin-left: 0;
    }
}

/* =========================
   Media / Gallery
   ========================= */
.e360 #panel {
    text-align: center;
    position: relative;
}
.e360 #image-wrapper {
    /* background: var(--bg); */
    /* border: 1px solid var(--border-strong); */
    overflow: hidden;
}
.e360 #largeImage {
    max-width: 100%;
    overflow: hidden;
    border-radius: 0.75rem;
}
.e360 #thumbs {
    padding-top: 10px;
    text-align: center;
}
.e360 #thumbs img {
    display: inline-block;
    width: 54px;
    height: 54px;
    margin-right: 2px;
    border-radius: 6px;
    cursor: pointer;
}

/* =========================
   Title & Price
   ========================= */
.e360 .title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}
.e360 .price {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
}
.e360 .compare {
    font-size: 0.875em;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 0.35rem;
}

/* =========================
   Description
   ========================= */
.e360 .desc h4 {
    font-weight: 500;
    margin: 0.625rem 0;
}
.e360 .desc .crop {
    position: relative;
    max-height: 12em;
    overflow: hidden;
    text-overflow: ellipsis;
}
.e360 .read-more {
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: underline;
}

/* =========================
   Card Grid (for listing grids)
   ========================= */
.e360 .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); /* 240–280px is a sweet spot */
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.e360 .cards > li {
    /* Let the grid define the width; no grid-column spans here */
    grid-column: auto !important;
}
@media (min-width: 640px) {
    .e360 .cards > li {
        grid-column: span 6;
    }
}
@media (min-width: 768px) {
    .e360 .cards > li {
        grid-column: span 4;
    }
}

.e360 .card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: white;
    /* border: 1px solid var(--border-strong); */
    transition: transform 0.2s ease, z-index 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none; /* no underline */
    color: inherit; /* keep text color */
    border-radius: 0.75rem;
    z-index: 99;
    grid-template-columns: repeat(auto-fit, minmax(200px, 300px)); /* min 240, max 360 per card */
}

.e360 .cards > li {
    grid-column: auto !important;
}
.e360 .card {
    width: 100%;
    max-width: 300px;
} /* belt & suspenders */

.e360 .card:hover {
    z-index: 9;
    transform: scale(1.05);
}

.e360 .card:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    z-index: 10;
}

.e360 .card-media {
    aspect-ratio: 1 / 1; /* square cards; adjust to 4/3 if you like */
    /* background: var(--bg-muted); */
    overflow: hidden;
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    margin-bottom: 10px;
}
.e360 .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* fill the area without distortion */
}

.e360 .card-body {
    display: inline-block;
    padding: 0;
}
.e360 .card-body h4 {
    font-size: 14px;
    margin: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.e360 .card-body p {
    font-size: 15px;
    line-height: 22px;
    margin-top: 0.5rem;
}

.e360 .badge {
    position: absolute;
    left: 0;
    top: 20px;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
    background: red;
    color: #fff;
    padding: 3px 10px;
}

.e360 .card-footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0 10px;
}

/* =========================
   Pagination
   ========================= */
.e360 .pagination {
    text-align: center;
}
.e360 .pagination ul {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
}
.e360 .pagination li a {
    display: inline-block;
    padding: 8px 16px;
    color: #000;
    border-radius: 0.375rem;
}
.e360 .pagination li a:hover {
    background: #ddd;
}
.e360 .pagination li a.active {
    background: #f3f3f3;
    color: var(--text);
}

/* =========================
   Accordion (no JS, <details>)
   ========================= */
.e360 details.accordion {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}
.e360 details.accordion + details.accordion {
    margin-top: 0.75rem;
}
.e360 details.accordion > summary {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.875rem 1rem;
    font-weight: 700;
    list-style: none; /* remove default triangle in Safari */
}
.e360 details.accordion[open] > summary {
    border-bottom: 1px solid var(--border);
}
.e360 details.accordion > summary::-webkit-details-marker {
    display: none;
}
.e360 .accordion-body {
    padding: 1rem;
}

/* Remove default disclosure arrow */
.accordion summary::-webkit-details-marker {
    display: none;
}

/* Layout + cursor */
.accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between; /* title on left, sign on right */
    cursor: pointer;
    padding: 0.625rem 0;
}

/* Plus by default */
.accordion summary::after {
    content: '+';
    font-weight: 500;
    line-height: 1;
    font-size: 24px;
    transition: transform 0.2s ease;
}

/* Minus when open */
.accordion[open] summary::after {
    content: '−'; /* true minus */
}

/* Focus styles for accessibility (tweak to your theme) */
.accordion summary:focus-visible {
    outline: 2px solid var(--brand, #f17288);
    outline-offset: 2px;
}

/* =========================
   Tables
   ========================= */
.e360 table.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin: 1rem 0;
}
.e360 table.table th,
.e360 table.table td {
    padding: 0.5rem 0.625rem;
    border-top: 1px solid var(--border);
}
.e360 table.table th {
    font-weight: 600;
    color: var(--text);
}

/* =========================
   Sidebar / Lists
   ========================= */
.e360 .sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.e360 .sidebar a {
    display: block;
    padding: 10px 5px;
    line-height: 25px;
    width: 100%;
}
.e360 .sidebar li:hover {
    color: #bdc3c7;
}

.e360 .sidebar li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.e360 .sidebar li span {
    display: flex;
    width: 25px;
}

/* =========================
   Price row / favorites
   ========================= */
.e360 .price-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
/* Base (works everywhere) */
.e360 .favorite {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    line-height: 1;
    font-size: 12px;
    font-weight: 600;
    color: #7d7d7d;
    z-index: 2;

    /* Glassy fallback without blur */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    /* Makes text crisper on translucent bg */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.e360 .item-fav-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 6px 9px;
    border-radius: 12%;
    background: #e5e5e5;
}

.e360 .button-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Real blur on browsers that support it */
@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
    .e360 .favorite {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
        -webkit-backdrop-filter: blur(10px) saturate(160%);
        backdrop-filter: blur(10px) saturate(160%);
        /* Slightly lighter border when blur is on */
        border-color: rgba(255, 255, 255, 0.45);
    }
}

/* Optional: dark mode tuning (keeps contrast on dark images) */
@media (prefers-color-scheme: dark) {
    .e360 .favorite {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06));
        border-color: rgba(255, 255, 255, 0.28);
    }
}

/* Optional: keep icon tidy */
.e360 .favorite svg {
    width: 16px;
    height: 16px;
    color: var(--brand, #f17288); /* heart color */
    flex: 0 0 16px;
}

/* =========================
   Overlay & Loading
   ========================= */
.e360 .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: none;
    cursor: pointer;
}
.e360 .overlay.show {
    display: grid;
    place-items: center;
}
.e360 .spinner {
    width: 40px;
    height: 40px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .e360 .card:hover {
        transform: none;
    }
    .e360 .reveal-link {
        transition: none;
    }
}

/* =========================
   Forms (basic, non-invasive)
   ========================= */
.e360 .select {
    position: relative;
    display: inline-block;
    min-width: 200px;
    max-width: 300px;
    width: 100%;
    border: 2px solid #646464;
    border-radius: 0.4em;
    height: 45px;
    background: transparent;
    transition: transform 0.2s;
}
.e360 .select:hover {
    transform: scale(1.01);
}
.e360 .select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    height: 41px;
    border: none;
    background: transparent;
    padding: 0 2.5rem 0 1rem;
    font-size: 1rem;
    color: var(--text);
}
.e360 .select .icon {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: grid;
    place-items: center;
    width: 2.5rem;
    border-left: 1px solid #c8c8c8;
    pointer-events: none;
}
.e360 select::-ms-expand {
    display: none;
} /* legacy IE arrow */

/* ========== Extras for listings grid ========== */

/* Powered by block */
.e360 .header-brand .powered-by {
    color: rgba(0, 0, 0, 0.5);
    font-size: 11px;
}
.e360 .header-brand .logo {
    width: 150px;
    opacity: 0.5;
    display: block;
}

/* Grid column helpers (mobile 1-col; at ≥640px use N columns) */
/* @media (min-width: 640px) {
    .e360 .cards.cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .e360 .cards.cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .e360 .cards.cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    /* Optional bigger screens:
  .e360 .cards.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .e360 .cards.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  */

/* Price text inside card footer (re-affirm size/weight if needed) */
.e360 .card-body .price {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}
