/**
 * SWS Woo Carousel — Frontend Styles
 * Version: 1.0.0
 */

/* ── Wrapper ────────────────────────────────────────────────────────────────── */
.sws-carousel-wrap {
    --sws-nav-color: #fff;
    --sws-nav-bg: #000;
    --sws-dot-color: #ccc;
    --sws-dot-active: #000;
    --sws-title-color: #111;
    --sws-price-color: #111;
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-bottom: 40px; /* space for dots */
}

/* ── Swiper overrides ───────────────────────────────────────────────────────── */
.sws-carousel-wrap .swiper {
    overflow: visible;
}

/* ── Card ───────────────────────────────────────────────────────────────────── */
.sws-product-card {
    background: #fff;
    border-radius: 0; /* Changed from 10px to 0 for the clean look */
    border: none;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sws-product-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

/* ── Image container ────────────────────────────────────────────────────────── */
.sws-product-image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Reduced to 75% for wide products like glasses */
    background: #f7f7f7;
    margin-bottom: 15px; /* Adds space between image and text */
}

.sws-product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Shows the full image without cropping */
    padding: 15px;       /* Adds breathing room inside the container */
    transition: transform 0.4s ease;
}

/* Ratios */
.sws-ratio-1-1  { aspect-ratio: 1 / 1; }
.sws-ratio-4-3  { aspect-ratio: 4 / 3; }
.sws-ratio-3-4  { aspect-ratio: 3 / 4; }
.sws-ratio-16-9 { aspect-ratio: 16 / 9; }

.sws-product-image a {
    display: block;
    height: 100%;
}

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

.sws-product-card:hover .sws-product-img {
    transform: scale(1.05);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.sws-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    line-height: 1.6;
}

.sws-badge-sale     { background: #e44; color: #fff; }
.sws-badge-featured { background: #f90; color: #fff; top: 38px; }

/* ── Body ───────────────────────────────────────────────────────────────────── */
/* ── Body - Left Aligned ────────────────────────────────────────────── */
.sws-product-body {
    padding: 5px 0; /* Tightened padding */
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    text-align: left; /* Aligned to left as per your request */
}



.sws-product-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.3 !important;
    min-height: 2.6em; /* Keeps height consistent even if title is short */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sws-product-title a {
    color: var(--sws-title-color);
    text-decoration: none;
}

.sws-product-title a:hover { text-decoration: underline; }

.sws-product-price {
    color: var(--sws-price-color);
   font-size: 14px;
    font-weight: 700;
}

.sws-product-price del { opacity: 0.5; font-weight: 400; font-size: 13px; }
.sws-product-price ins { text-decoration: none; }

/* ── Rating ─────────────────────────────────────────────────────────────────── */
.sws-rating .star-rating { font-size: 12px; }

/* ── Button ─────────────────────────────────────────────────────────────────── */
.sws-product-btn-wrap {
    margin-top: auto;
    padding-top: 15px;
}

.sws-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background: #fff;
    color: #000;
    border: 1px solid #000; /* Thin black outline */
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.sws-btn:hover {
    background: #000;
    color: #fff;
}
.sws-product-btn-wrap {
    margin-top: auto;
    padding-top: 6px;
}

/**
.sws-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease;
    background: #111;
    color: #fff;
    border: none;
    box-sizing: border-box;
}

.sws-btn:hover { opacity: 0.85; color: #fff; }
**/
.sws-btn-outofstock { background: #aaa; cursor: not-allowed; }

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.sws-carousel-wrap .swiper-button-next,
.sws-carousel-wrap .swiper-button-prev {
    width: 42px;
    height: 42px;
    background: var(--sws-nav-bg);
    color: var(--sws-nav-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: opacity 0.2s ease;
    top: 35%;
}

.sws-carousel-wrap .swiper-button-next::after,
.sws-carousel-wrap .swiper-button-prev::after {
    display: none; /* We use our own SVG icons */
}

.sws-carousel-wrap .swiper-button-next svg,
.sws-carousel-wrap .swiper-button-prev svg {
    width: 18px;
    height: 18px;
}

.sws-carousel-wrap .swiper-button-next:hover,
.sws-carousel-wrap .swiper-button-prev:hover { opacity: 0.8; }

.sws-carousel-wrap .swiper-button-disabled { opacity: 0.3; pointer-events: none; }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.sws-carousel-wrap .swiper-pagination {
    bottom: -35px;
}

.sws-carousel-wrap .swiper-pagination-bullet {
    background: var(--sws-dot-color);
    opacity: 1;
    width: 8px;
    height: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sws-carousel-wrap .swiper-pagination-bullet-active {
    background: var(--sws-dot-active);
    transform: scale(1.4);
}

/* Progress bar pagination */
.sws-carousel-wrap .swiper-pagination-progressbar {
    background: var(--sws-dot-color);
    height: 3px;
}
.sws-carousel-wrap .swiper-pagination-progressbar-fill {
    background: var(--sws-dot-active);
}

/* ── Modern layout ──────────────────────────────────────────────────────────── */
.sws-layout-modern .sws-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.sws-layout-modern .sws-product-card:hover .sws-hover-overlay { opacity: 1; }

.sws-layout-modern .sws-quick-link {
    color: #fff;
    border: 2px solid #fff;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.sws-layout-modern .sws-quick-link:hover {
    background: #fff;
    color: #000;
}

/* ── Minimal layout ─────────────────────────────────────────────────────────── */
.sws-layout-minimal .sws-product-card {
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #eee;
}

.sws-layout-minimal .sws-product-card:hover {
    box-shadow: none;
    transform: none;
}

.sws-layout-minimal .sws-btn {
    background: transparent;
    color: #111;
    border: 1px solid #111;
}

.sws-layout-minimal .sws-btn:hover {
    background: #111;
    color: #fff;
    opacity: 1;
}

/* ── Error (admins only) ────────────────────────────────────────────────────── */
.sws-carousel-error {
    border-left: 4px solid #e44;
    padding: 10px 16px;
    background: #fff5f5;
    font-size: 13px;
    color: #900;
}

/* ── RTL ────────────────────────────────────────────────────────────────────── */
[dir="rtl"] .sws-badge { left: auto; right: 10px; }
[dir="rtl"] .sws-badge-featured { left: auto; right: 10px; }
