/*
 Theme Name:   GeneratePress Child (Adhoc Powered)
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/**
*
* ROOTS / GENERALES
*
**/

:root{
    --color-primary: #0073aa;
    --color-secondary: #23282d;
    --color-heading: #23282d;
    --color-text: #23282d;
    --color-text-muted: #555;
}

.texto h1, 
.texto h2, 
.texto h3, 
.texto h4, 
.texto h5, 
.texto h6 {
    color: var(--color-heading);
}

.texto p,
.texto li,
.texto span{
    color: var(--color-text);
}

.texto a {
    color: var(--color-primary);
}

/* ============================
* FUNCTIONS.PHP STYLING - ADHOC 
============================ */

/* Eventos/Contador carrito */

.cart-count--hidden { display: none !important; }

@keyframes cart-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.45); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.cart-count--bump { animation: cart-bump 0.35s ease; }

/* Lang Dropdown - adhoc_lang_switcher */

.lang-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.lang-dropdown .current-lang {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-dropdown .current-lang img {
    width: 24px;
    height: auto;
    display: block;
    border-radius: 2px;
}

.lang-dropdown .rest-of-langs {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 9999;
    flex-direction: column;
    gap: 4px;
    min-width: 80px;
}

.lang-dropdown:hover .rest-of-langs {
    display: flex;
}

.lang-dropdown .lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.lang-dropdown .lang-item:hover {
    background: #f0f0f0;
}

.lang-dropdown .lang-item img {
    width: 22px;
    height: auto;
    border-radius: 2px;
}

.lang-dropdown .lang-item span {
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ================================================
   GALERÍA — single-product.php
   ================================================ */

.sp-gallery {
    position: sticky;
    top: 20px;
}

.sp-gallery__main {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 10px;
}

.sp-gallery__main-link {
    display: block;
    cursor: zoom-in;
}

.sp-gallery__main-img {
    width: 100%;
    height: auto;
    max-height: 70dvh;
    object-fit: contain;
    object-position: center;
    display: block;
    background: #f9f9f9;
    transition: opacity 0.25s ease;
}

.sp-gallery__main-img--fade {
    opacity: 0.4;
}

/* Links ocultos para GLightbox — visually hidden */
.obra-lightbox-links {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    clip: rect(0,0,0,0);
}

.sp-gallery__hidden-link {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    clip: rect(0,0,0,0);
}

/* Flechas de GLightbox visibles también en móvil */
.gnext,
.gprev {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Strip de miniaturas */
.sp-gallery__thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.sp-gallery__thumbs::-webkit-scrollbar {
    height: 4px;
}
.sp-gallery__thumbs::-webkit-scrollbar-track { background: transparent; }
.sp-gallery__thumbs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.sp-gallery__thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    background: #f5f5f5;
    cursor: pointer;
    overflow: hidden;
    border-radius: 3px;
    opacity: 0.55;
    transition: opacity 0.2s, border-color 0.2s;
}

.sp-gallery__thumb:hover {
    opacity: 0.85;
}

.sp-gallery__thumb.is-active {
    border-color: #111;
    opacity: 1;
}

.sp-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.sp-gallery__placeholder img {
    width: 100%;
    height: auto;
    display: block;
}

/* Badge de oferta */
.sp-gallery .onsale {
    background: #111;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
    top: 12px;
    left: 12px;
}


/* =========
 WEBSITE CSS
========== */


/* Header */

/* Body */

/* Footer */


/* Responsive */

@media (max-width: 900px) {
    .sp-gallery {
        position: relative;
    }

    .sp-gallery .woocommerce-product-gallery {
        position: relative;
        top: auto;
    }
}
