* {
    box-sizing: border-box;
}

.sgw-wrap {
    background: var(--sgw-bg, #0b1220);
    padding: 20px;
    border-radius: 15px;
    position: relative;
}

.sgw-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--sgw-cols, 4), 1fr) !important;
    gap: 20px !important;
}

.swiper-wrapper.sgw-grid {
    display: flex !important;
}

.swiper-slide {
    width: auto;
    height: auto;
}

.swiper-button-prev,
.swiper-button-next {
    color: #000;
    background: rgba(255, 255, 255, 0.7);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 18px;
}

/* ===== DESKTOP ===== */
@media (min-width: 1025px) {
    .sgw-grid {
        grid-template-columns: repeat(var(--sgw-cols, 4), 1fr) !important;
        gap: 20px;
    }
}

/* ===== TABLET ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .sgw-grid {
        grid-template-columns: repeat(var(--sgw-cols-tablet, 3), 1fr) !important;
        gap: 15px;
    }
    .sgw-wrap {
        padding: 15px;
    }
}

/* ===== MOBILE (PRINCIPAL) ===== */
@media (max-width: 768px) {
    .sgw-grid {
        grid-template-columns: repeat(var(--sgw-cols-mobile, 2), 1fr) !important;
        gap: 12px;
    }
    .sgw-wrap {
        padding: 10px;
    }
}

/* ===== MOBILE PEQUENO ===== */
@media (max-width: 600px) {
    .sgw-grid {
        grid-template-columns: repeat(var(--sgw-cols-mobile, 2), 1fr) !important;
        gap: 10px;
    }
    .sgw-wrap {
        padding: 8px;
    }
}

/* ===== MOBILE EXTRA PEQUENO ===== */
@media (max-width: 480px) {
    .sgw-grid {
        grid-template-columns: repeat(var(--sgw-cols-mobile, 2), 1fr) !important;
        gap: 8px;
    }
    .sgw-wrap {
        padding: 6px;
    }
    .swiper-button-prev,
    .swiper-button-next {
        width: 35px;
        height: 35px;
    }
}

/* ===== MOBILE ULTRA PEQUENO ===== */
@media (max-width: 380px) {
    .sgw-grid {
        grid-template-columns: repeat(var(--sgw-cols-mobile, 2), 1fr) !important;
        gap: 6px;
    }
    .sgw-wrap {
        padding: 4px;
    }
}

.sgw-card {
    background: var(--sgw-card-bg, #0f172a);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    min-height: 100%;
}

.sgw-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sgw-media-wrapper {
    position: relative;
    display: block;
    background: var(--sgw-image-bg, #0a0f1a);
    width: calc(100% + 30px);
    margin: -15px -15px 15px -15px;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.sgw-media {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sgw-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

/* Carrossel de Imagens */
.sgw-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sgw-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
}

.sgw-carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sgw-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
}

.sgw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.sgw-dot.active {
    background: var(--sgw-primary, #34d399);
    width: 24px;
    border-radius: 4px;
    border-color: var(--sgw-primary, #34d399);
}

.sgw-carousel-prev,
.sgw-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.85); /* fundo escuro */
    color: #ffffff;                   /* ✅ SETA BRANCA */
    border: 1px solid rgba(255,255,255,0.25);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 15;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
    opacity: 0;
    visibility: hidden;
}


.sgw-carousel:hover .sgw-carousel-prev,
.sgw-carousel:hover .sgw-carousel-next {
    opacity: 1;
    visibility: visible;
}

.sgw-carousel.single-image .sgw-carousel-prev,
.sgw-carousel.single-image .sgw-carousel-next,
.sgw-carousel.single-image .sgw-carousel-dots {
    display: none;
}

.sgw-carousel-prev:hover,
.sgw-carousel-next:hover {
    background: var(--sgw-primary, #34d399);
    transform: translateY(-50%) scale(1.1);
}

.sgw-carousel-prev {
    left: 8px;
}

.sgw-carousel-next {
    right: 8px;
}

.sgw-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 8px 14px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.sgw-badge-sale {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sgw-badge-new {
    background: linear-gradient(135deg, var(--sgw-primary, #34d399) 0%, #10b981 100%);
    color: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sgw-logo {
    position: absolute;
    z-index: 5;
}

.sgw-logo-top-left {
    top: 15px;
    left: 15px;
}

.sgw-logo-top-right {
    top: 15px;
    right: 15px;
}

.sgw-logo-bottom-left {
    bottom: 15px;
    left: 15px;
}

.sgw-logo-bottom-right {
    bottom: 15px;
    right: 15px;
}

.sgw-logo-middle-left {
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
}

.sgw-logo-middle-right {
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

.sgw-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    padding: var(--sgw-padding, 15px);
}

.sgw-title {
    margin: 0;
    font-size: var(--sgw-title-size, 14px);
    font-weight: bold;
    color: var(--sgw-title-color, #ffffff);
    line-height: 1.3;
}

.sgw-title a {
    color: inherit;
    text-decoration: none;
}

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

.sgw-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: var(--sgw-card-text, #e5e7eb);
}

.sgw-meta-item {
    padding: 4px 8px;
    background: rgba(52, 211, 153, 0.1);
    border-radius: 4px;
    word-break: break-word;
}

.sgw-meta-item strong {
    color: var(--sgw-primary, #34d399);
}

.sgw-price {
    padding: 10px;
    background: rgba(52, 211, 153, 0.15);
    color: var(--sgw-primary, #34d399);
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: var(--sgw-price-size, 16px);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.sgw-price .woocommerce-Price-amount {
    color: inherit;
}

.sgw-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.sgw-btn,
.sgw-cart-btn {
    flex: 1;
    padding: 10px 8px;
    background: var(--sgw-btn-bg, #34d399);
    color: var(--sgw-btn-text, #071018);
    border: none;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sgw-btn:hover,
.sgw-cart-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.sgw-cart-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sgw-cart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sgw-load-more-wrapper {
    text-align: center;
    margin-top: 30px;
}

.sgw-load-more {
    padding: 12px 30px;
    background: var(--sgw-primary, #34d399);
    color: #071018;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sgw-load-more:hover {
    transform: translateY(-2px);
}

.sgw-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .sgw-btn,
    .sgw-cart-btn {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .sgw-title {
        font-size: calc(var(--sgw-title-size, 14px) * 0.9);
    }
    
    .sgw-price {
        font-size: calc(var(--sgw-price-size, 16px) * 0.9);
    }
    
    .sgw-meta-item {
        font-size: 11px;
    }
}

/* =========================
   SGW FILTER (Modern Design)
========================= */
.sgw-filter {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    margin: 20px 0 25px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(10, 15, 26, 0.95) 100%);
    border: 2px solid rgba(52, 211, 153, 0.4);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.sgw-filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.sgw-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(52, 211, 153, 0.95);
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sgw-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 25px;
    border: 2px solid rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.08);
    color: rgba(229, 231, 235, 0.95);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.sgw-chip:hover {
    border-color: rgba(52, 211, 153, 0.9);
    background: rgba(52, 211, 153, 0.2);
    box-shadow: 0 4px 16px rgba(52, 211, 153, 0.25);
    transform: translateY(-2px);
}

.sgw-chip.is-active {
    border-color: rgba(52, 211, 153, 1);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.35) 0%, rgba(52, 211, 153, 0.2) 100%);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.35);
    font-weight: 600;
}

.sgw-filter-select {
    min-width: 200px;
    max-width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 2px solid rgba(52, 211, 153, 0.4);
    background: rgba(15, 23, 42, 0.7);
    color: rgba(229, 231, 235, 0.95);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(52,211,153,0.9)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 36px;
}

.sgw-filter-select:hover {
    border-color: rgba(52, 211, 153, 0.7);
    background-color: rgba(15, 23, 42, 0.85);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2);
}

.sgw-filter-select:focus {
    border-color: rgba(52, 211, 153, 1);
    background-color: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

.sgw-filter-select option {
    background: #0f172a;
    color: #e5e7eb;
    padding: 8px;
}

/* Mobile: mais compacto */
@media (max-width: 520px) {
    .sgw-filter {
        gap: 10px;
        padding: 12px 14px;
        margin: 15px 0 18px;
    }
    
    .sgw-filter-label {
        display: none;
    }
    
    .sgw-chip {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .sgw-filter-select {
        min-width: 150px;
        padding: 9px 12px;
        font-size: 12px;
    }
}
