/* ============================================================
   Shopify Rotation Widget – widget.css
   ============================================================ */

/* ── Container ─────────────────────────────────────────────── */
.srw-widget {
    position:        relative;
    display:         inline-block;
    overflow:        hidden;
    border-radius:   12px;
    box-shadow:      0 4px 20px rgba(0,0,0,0.12);
    background:      #f8f8f8;
    font-family:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor:          pointer;
    -webkit-user-select: none;
    user-select:     none;
}

/* ── Track (holds all slides) ───────────────────────────────── */
.srw-track {
    position: relative;
    width:    100%;
    height:   calc(100% - 44px); /* leave room for controls */
}

/* ── Individual product cards ───────────────────────────────── */
.srw-card {
    position:   absolute;
    inset:      0;
    display:    flex;
    flex-direction: column;
    text-decoration: none;
    color:      inherit;
    outline:    none;
}

.srw-card:focus-visible {
    box-shadow: inset 0 0 0 3px #3b82f6;
}

/* ── Image area ─────────────────────────────────────────────── */
.srw-card__image-wrap {
    flex:       1;
    overflow:   hidden;
    background: #e8e8e8;
}

.srw-card__image-wrap img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: transform 0.4s ease;
}

.srw-card:hover .srw-card__image-wrap img {
    transform: scale(1.04);
}

/* ── Info bar ───────────────────────────────────────────────── */
.srw-card__info {
    padding:        10px 14px 8px;
    background:     #fff;
    display:        flex;
    align-items:    center;
    justify-content: space-between;
    gap:            8px;
    flex-shrink:    0;
}

.srw-card__title {
    font-size:      14px;
    font-weight:    600;
    color:          #111;
    white-space:    nowrap;
    overflow:       hidden;
    text-overflow:  ellipsis;
    flex:           1;
    line-height:    1.3;
}

.srw-card__price {
    font-size:      14px;
    font-weight:    700;
    color:          #059669;
    white-space:    nowrap;
    flex-shrink:    0;
}

/* ── Shop Now button ────────────────────────────────────────── */
.srw-card__button {
    display:        block;
    text-align:     center;
    padding:        7px 14px;
    margin:         0 14px 10px;
    background:     #111;
    color:          #fff !important;
    font-size:      13px;
    font-weight:    600;
    border-radius:  6px;
    text-decoration: none;
    transition:     background 0.2s, transform 0.15s;
    flex-shrink:    0;
}

.srw-card:hover .srw-card__button {
    background: #333;
    transform: translateY(-1px);
}

/* ── "Sold Out" badge ───────────────────────────────────────── */
.srw-card__soldout {
    position:    absolute;
    top:         12px;
    right:       12px;
    background:  rgba(0,0,0,0.65);
    color:       #fff;
    font-size:   11px;
    font-weight: 700;
    padding:     3px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    pointer-events: none;
}

/* ── Controls bar ───────────────────────────────────────────── */
.srw-controls {
    position:        absolute;
    bottom:          0;
    left:            0;
    right:           0;
    height:          44px;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         0 10px;
    background:      rgba(255,255,255,0.95);
    backdrop-filter: blur(4px);
    border-top:      1px solid rgba(0,0,0,0.06);
    z-index:         10;
}

/* ── Prev / Next buttons ────────────────────────────────────── */
.srw-prev,
.srw-next {
    width:       28px;
    height:      28px;
    border:      1px solid #ddd;
    border-radius: 50%;
    background:  #fff;
    cursor:      pointer;
    font-size:   18px;
    line-height: 1;
    display:     flex;
    align-items: center;
    justify-content: center;
    padding:     0;
    color:       #444;
    flex-shrink: 0;
    transition:  background 0.15s, border-color 0.15s;
}

.srw-prev:hover,
.srw-next:hover {
    background:    #f0f0f0;
    border-color:  #bbb;
}

/* ── Dot indicators ─────────────────────────────────────────── */
.srw-dots {
    display:    flex;
    gap:        6px;
    align-items: center;
    flex:       1;
    justify-content: center;
    flex-wrap:  wrap;
    padding:    0 4px;
}

.srw-dot {
    width:          7px;
    height:         7px;
    border-radius:  50%;
    background:     #ccc;
    cursor:         pointer;
    transition:     background 0.2s, transform 0.2s;
    border:         none;
    padding:        0;
    flex-shrink:    0;
}

.srw-dot.is-active {
    background: #111;
    transform:  scale(1.3);
}

/* ── Progress bar ───────────────────────────────────────────── */
.srw-progress {
    position:   absolute;
    bottom:     44px;
    left:       0;
    height:     3px;
    background: rgba(0,0,0,0.25);
    width:      0%;
    transition: width linear;
    z-index:    9;
}

/* ══════════════════════════════════════════════════════════════
   ANIMATION STYLES
   ══════════════════════════════════════════════════════════════ */

/* ── Fade mode ──────────────────────────────────────────────── */
.srw-style-fade .srw-card {
    opacity:    0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.srw-style-fade .srw-card.is-active {
    opacity:    1;
    pointer-events: auto;
    z-index:    2;
}

/* ── Slide mode ─────────────────────────────────────────────── */
.srw-style-slide .srw-track {
    display: flex;
    /* width is set by JS based on product count */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.srw-style-slide .srw-card {
    flex-shrink:    0;
    position:       relative;
    inset:          unset;
    /* width is set by JS */
}

/* ── Hover: pause rotation hint ─────────────────────────────── */
.srw-widget:hover .srw-progress {
    animation-play-state: paused;
}

/* ── Responsive: scale gracefully if parent is narrow ───────── */
@media (max-width: 360px) {
    .srw-card__title { font-size: 12px; }
    .srw-card__price { font-size: 12px; }
    .srw-card__button { font-size: 12px; padding: 6px 10px; }
}
