/* BannedCamp Cover Theme */

.product {
    position: relative;
}

.snd-cover-player-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;             /* center children within the image bounds */
    align-items: center;       /* vertical center */
    justify-content: center;   /* horizontal center */
}

/* Target the wrapper when it's inside the image container */
img.woocommerce-placeholder + .snd-cover-player-wrapper,
img.attachment-woocommerce_thumbnail + .snd-cover-player-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Play button overlay - center within wrapper (image area) */
.snd-play-on-cover {
    position: relative !important;  /* no absolute offsets */
    top: auto !important;
    left: auto !important;
    transform: none !important;
    background: transparent;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 0 !important;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: none;
    font-size: 0;
    font-weight: bold;
    outline: none;
    pointer-events: auto;
    text-align: center;
    line-height: 58px;
}

/* Play button icon */
.snd-play-on-cover:not(.playing)::before {
    content: '▶';
    font-size: 28px;
    color: white;
}

/* Pause button icon */
.snd-play-on-cover.playing::before {
    content: '❚❚';
    font-size: 20px;
    color: white;
}

.snd-play-on-cover:hover {
    background: transparent;
    backdrop-filter: blur(7px);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
    color: white;
}

.snd-play-on-cover:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

/* Playing state */
.snd-play-on-cover.playing {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.snd-play-on-cover.playing:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Track navigation buttons - BannedCamp theme style */
.snd-prev-track,
.snd-next-track {
    position: absolute;
    top: 200px !important;
    background: transparent !important;
    border: none !important;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 19px;
    width: 40px;
    height: 40px;
    padding: 0;
    box-shadow: none !important;
    outline: none !important;
    pointer-events: auto;
}

.snd-prev-track {
    left: 5px;
}

.snd-next-track {
    right: 5px;
}

.snd-prev-track:hover,
.snd-next-track:hover {
    color: #8A2BE2 !important;
    background: transparent !important;
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.8);
}

.snd-prev-track:focus,
.snd-next-track:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.snd-prev-track:active,
.snd-next-track:active {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Hide the hidden player container */
.snd-hidden-player-container {
    display: none !important;
}

/* Ensure WooCommerce product images are relatively positioned */
.woocommerce ul.products li.product .woocommerce-LoopProduct-link,
.woocommerce ul.products li.product > a:first-child {
    position: relative;
    display: block;
    line-height: 0;          /* remove baseline gap under img so height === image */
    overflow: hidden;        /* clip overlay strictly to the image box */
}

/* Always bind overlay to the image link context (works even if theme wraps IMG) */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.woocommerce ul.products li.product a.woocommerce-loop-product__link {
    position: relative;
    display: block;
    line-height: 0;
    overflow: hidden;
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link img,
.woocommerce ul.products li.product a.woocommerce-loop-product__link img {
    display: block;
    width: 100%;
    height: auto;
}

/* Descendant selector so wrapper can be anywhere under the link */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link .snd-cover-player-wrapper,
.woocommerce ul.products li.product a.woocommerce-loop-product__link .snd-cover-player-wrapper {
    position: absolute !important;
    inset: 0 !important;
    z-index: 10 !important;
    pointer-events: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure the play button itself relies on wrapper centering */
.snd-play-on-cover {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* Fix image spacing issues in product grid */
.woocommerce ul.products li.product img {
    display: block; /* Remove inline-block gap */
    width: 100%;
    height: auto;
    margin: 0 !important; /* kill theme margins that shift visual center */
}

/* Apply positioning to both mobile and desktop */
/* Nudge the centered play button up by ~10px */
.snd-play-on-cover {
    transform: translateY(-10px) !important;
}

/* Keep nav buttons vertically centered relative to the image */
.snd-prev-track,
.snd-next-track {
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important; /* ensure no bottom anchoring from other skins */
}

.snd-prev-track { left: 8px; }
.snd-next-track { right: 8px; }
