/* ============================================================
   BLACK SHEEP — PRODUCT PAGES CSS
   Estilos para páginas de categoría + carrito
   ============================================================ */

/* ─── PRODUCT HERO ───────────────────────────────────────── */
.product-hero {
    min-height: 40vh;
    display: flex;
    align-items: flex-end;
    padding-top: 100px;
    padding-bottom: 60px;
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
}

.product-hero-content {
    position: relative;
    z-index: 1;
}

.product-hero-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.product-hero-back:hover {
    color: var(--text-primary);
}

.product-hero-back svg {
    transition: transform 0.2s ease;
}

.product-hero-back:hover svg {
    transform: translateX(-3px);
}

.product-hero-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 14px;
    border-radius: 9999px;
    margin-bottom: 16px;
}

.product-hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.product-hero-desc {
    font-size: 1.05rem;
    color: var(--text-tertiary);
    max-width: 500px;
}

.product-hero-icon {
    font-size: 5rem;
    position: absolute;
    right: 10%;
    bottom: 20px;
    opacity: 0.08;
    font-style: normal;
    user-select: none;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

/* ─── PRODUCT SECTION ────────────────────────────────────── */
.products-section {
    padding: 80px 0 120px;
    background: var(--bg-primary);
}

.products-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 16px;
}

.products-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.products-count span {
    color: var(--text-primary);
    font-weight: 600;
}

/* ─── PRODUCT GRID ───────────────────────────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ─── PRODUCT CARD ───────────────────────────────────────── */
.product-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-6px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* Product Image */
.product-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-card);
    cursor: zoom-in;
}

.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.product-card:hover .product-img-wrap img {
    transform: scale(1.06);
}

.product-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #1a1a1a, #252525);
    color: rgba(255, 255, 255, 0.2);
}

.product-img-placeholder span {
    font-size: 3rem;
}

.product-img-placeholder p {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 4px 12px;
    border-radius: 9999px;
    z-index: 2;
}

.badge-new {
    background: #22c55e;
    color: #000;
}

.badge-hot {
    background: #f97316;
    color: #000;
}

.badge-sale {
    background: #ef4444;
    color: #fff;
}

.badge-stock {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.product-zoom-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.product-card:hover .product-zoom-btn {
    opacity: 1;
}

.product-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Product Body */
.product-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.product-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-specs {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-specs li {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-specs li::before {
    content: '›';
    color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
}

/* Variant selector */
.product-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.variant-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    width: 100%;
    margin-bottom: 2px;
}

.variant-btn {
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.variant-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
    font-weight: 700;
}

/* Product footer */
.product-footer {
    padding: 0 22px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.price-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.price-old {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--accent);
    color: var(--bg-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

.add-to-cart-btn:active {
    transform: scale(0.97);
}

.add-to-cart-btn.added {
    background: #22c55e;
    color: #000;
}

/* ─── PRODUCT MODAL (ZOOM) ───────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 24px;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    transform: scale(0.92);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-box {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.modal-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 24px 0 0 24px;
    display: block;
}

.modal-img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-card);
    border-radius: 24px 0 0 24px;
    color: rgba(255, 255, 255, 0.15);
}

.modal-img-placeholder span {
    font-size: 4rem;
}

.modal-content {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.modal-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
}

.modal-specs {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-specs li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-specs li::before {
    content: '✓';
    color: #22c55e;
    font-weight: 700;
}

.modal-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.modal-price {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-price-old {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.modal-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
}

.modal-actions .add-to-cart-btn {
    flex: 1;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
}

.modal-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: #25d366;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.modal-wa-btn:hover {
    background: #128c7e;
    transform: translateY(-1px);
}

/* ─── CART PANEL ─────────────────────────────────────────── */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: #0f0f0f;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-panel.open {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-body::-webkit-scrollbar {
    width: 4px;
}

.cart-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    min-height: 200px;
    text-align: center;
    color: var(--text-muted);
}

.cart-empty p {
    font-size: 1rem;
}

.cart-empty small {
    font-size: 0.82rem;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    align-items: flex-start;
}

.cart-item-img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: var(--bg-card) center/cover no-repeat;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-variant {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin: 2px 0 6px;
}

.cart-item-price {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cart-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.qty-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.qty-num {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.cart-item-subtotal {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-remove-btn {
    width: 26px;
    height: 26px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 6px;
    color: rgba(239, 68, 68, 0.7);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.cart-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.cart-total-row strong {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.cart-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}

.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: #25d366;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cart-checkout-btn:hover:not(:disabled) {
    background: #128c7e;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
}

.cart-checkout-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cart-clear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s ease;
    padding: 4px;
}

.cart-clear-btn:hover {
    color: #ef4444;
}

/* ─── CART NAV BUTTON ────────────────────────────────────── */
.cart-nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.cart-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ─── TOAST ──────────────────────────────────────────────── */
#cart-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 3000;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    backdrop-filter: blur(12px);
    pointer-events: none;
}

#cart-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-box {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .modal-img,
    .modal-img-placeholder {
        border-radius: 24px 24px 0 0;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .cart-panel {
        width: 100vw;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .add-to-cart-btn {
        justify-content: center;
    }

    .modal-box {
        border-radius: 16px;
    }
}