/* =========== 
   LAYOUT BASE
   =========== */

.gr-pc {
    font-family: inherit;
    color: #1e1e1e;
    font-size: 14px;
    box-sizing: border-box;
}

.gr-pc * {
    box-sizing: inherit;
}

/* FILTROS (ASIDE) */

.gr-pc--filters {
    background: #f7f7fb;
    border-right: 1px solid #e1e3eb;
    padding: 16px 20px;
}

.gr-pc__filters-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gr-pc__filters-applied {
    border-bottom: 1px solid #e1e3eb;
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.gr-pc__filters-applied-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.gr-pc__filters-label {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.gr-pc__filters-clear {
    font-size: 12px;
    text-decoration: underline;
    color: #777;
}

.gr-pc__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Wrapper interno para scroll y espaciado correcto */
.gr-pc__filters-scroll-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gr-pc__chip {
    font-size: 12px;
    padding: 4px 8px;
    background: #fff;
    border-radius: 999px;
    border: 1px solid #d1d5e6;
}

.gr-pc__search-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5e6;
    font-size: 13px;
}

/* Grupos */

.gr-pc__filters-group {
    border-bottom: 1px solid #e1e3eb;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.gr-pc__filters-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Acordeón */

.gr-pc__filters-accordion-trigger {
    width: 100%;
    border: 0;
    background: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.gr-pc__filters-accordion-icon {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.gr-pc__filters-group.is-expanded .gr-pc__filters-accordion-icon {
    transform: rotate(180deg);
}

.gr-pc__filters-accordion-panel {
    margin-top: 6px;
    display: none;
    /* Colapsado por defecto */
}

.gr-pc__filters-group.is-expanded .gr-pc__filters-accordion-panel {
    display: block;
}

.gr-pc__filters-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow: hidden;
    overflow-y: auto;
    /* Scroll si es muy largo */
}

/* Breadcrumbs */
.gr-pc__breadcrumb {
    margin-bottom: 8px;
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.gr-pc__breadcrumb a {
    color: #0000ed;
    /* Azul link */
    text-decoration: none;
}

.gr-pc__breadcrumb a:hover {
    text-decoration: underline;
}

.gr-pc__filters-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 13px;
}

.gr-pc__filters-option input {
    margin-right: 4px;
}

.gr-pc__filters-option-count {
    font-size: 11px;
    color: #777;
}

.gr-pc__show-more {
    margin-top: 6px;
    border: 0;
    background: none;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    color: #555;
}

.gr-pc__filters-apply {
    margin-top: 6px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    background: #f8941d;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.gr-pc__filters-empty {
    font-size: 12px;
    color: #777;
}

/* ==========================
   CATALOGO / LISTADO
   ========================== */

.gr-pc--catalog {
    padding: 16px 0 24px;
}

/* Header */

.gr-pc__header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.gr-pc__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
}

.gr-pc__subtitle {
    font-size: 13px;
    color: #555;
    margin: 0;
}

.gr-pc__header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Toggle vista */

.gr-pc__view-toggle {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d1d5e6;
}

.gr-pc__view-btn {
    border: 0;
    background: #f3f4f7;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
}

.gr-pc__view-btn.is-active {
    background: #f8941d;
    color: #fff;
}

/* Orden */

.gr-pc__sort-form {
    display: none;
    align-items: center;
    gap: 6px;
}

.gr-pc__sort-label {
    font-size: 13px;
}

.gr-pc__sort-select {
    font-size: 13px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #d1d5e6;
    cursor: pointer;
}

/* Header pages (TOP Pagination Container) */

.gr-pc__header-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}

/* Grid / List */

.gr-pc__products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Vista lista: producto full width */

.gr-pc--view-list .gr-pc__products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tarjeta producto */

.gr-pc__product {
    display: grid;
    grid-template-columns: 120px 1fr 180px;
    gap: 16px;
    align-items: stretch;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e1e3eb;
    background: #fff;
    transition: box-shadow 0.2s;
}

.gr-pc__product:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.gr-pc--view-grid .gr-pc__product {
    grid-template-columns: 1fr;
}

.gr-pc__product-media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Info */

.gr-pc__product-title {
    font-size: 16px;
    margin: 0 0 6px;
    font-weight: 600;
}

.gr-pc__product-title a {
    text-decoration: none;
    color: #222;
}

.gr-pc__product-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #444;
}

.gr-pc__product-meta li+li {
    margin-top: 2px;
}

/* Acciones */

.gr-pc__product-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
}

.gr-pc__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5e6;
    border-radius: 6px;
    overflow: hidden;
}

.gr-pc__qty-btn {
    border: 0;
    background: #f3f4f7;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

.gr-pc__qty-input {
    width: 50px;
    border: 0;
    text-align: center;
    font-size: 14px;
    padding: 4px;
}

.gr-pc__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s;
}

.gr-pc__btn--primary {
    background: #f8941d;
    color: #fff;
    border-color: #f8941d;
}

.gr-pc__btn--primary:hover {
    background: #e08316;
}

.gr-pc__btn--view {
    background: #fff;
    color: #f8941d;
    border: 1px solid #f8941d;
}

.gr-pc__btn--view:hover {
    background: #fff5e6;
}

.gr-pc__btn-quote {
    gap: 6px;
}

.gr-pc__btn-icon img {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0) invert(1);
    /* Make icon white if SVG is black */
}

/* Loading state for quote button */
.gr-pc__btn-quote.is-loading .gr-pc__btn-text,
.gr-pc__btn-quote.is-loading .gr-pc__btn-icon {
    display: none;
}

/* Mensajes */

.gr-pc__empty {
    font-size: 14px;
    color: #555;
}

/* Responsive */



/* =====================
   Skeleton loading
   ===================== */

.gr-pc--loading .gr-pc__product {
    pointer-events: none;
}

.gr-pc__product--skeleton .gr-pc__product-media,
.gr-pc__product--skeleton .gr-pc__product-info,
.gr-pc__product--skeleton .gr-pc__product-actions {
    animation: grPcSkeletonPulse 1.2s ease-in-out infinite;
}

.gr-pc__sk-box {
    background: #e3e5ec;
    border-radius: 4px;
    height: 10px;
    margin-bottom: 6px;
}

.gr-pc__sk-media {
    height: 140px;
}

.gr-pc__sk-title {
    height: 18px;
    width: 70%;
    margin-bottom: 10px;
}

.gr-pc__sk-line {
    height: 10px;
    width: 90%;
}

.gr-pc__sk-input {
    height: 32px;
    width: 60%;
}

.gr-pc__sk-btn {
    height: 32px;
    width: 100%;
}

@keyframes grPcSkeletonPulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

/* =====================
   Dual Pagination (Top & Bottom)
   ===================== */

/* Common Button Styles */
.gr-pc__pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 4px;
    border: 1px solid #d1d5e6;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
    color: #333;
}

.gr-pc__pagination-btn:hover:not(:disabled) {
    border-color: #f8941d;
    color: #f8941d;
}

.gr-pc__pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
    color: #aaa;
}

.gr-pc__pagination-btn.is-active {
    background: #f8941d;
    border-color: #f8941d;
    color: #fff;
    font-weight: 600;
}

/* Top Pagination Specifics (Compact) */
.gr-pc__pagination-btn--top {
    width: 30px;
    height: 30px;
    font-size: 18px;
    padding: 0;
}

.gr-pc__pagination-info {
    font-weight: 500;
    margin: 0 4px;
}

/* Bottom Numbered Pagination Container */
.gr-pc__pagination--numbered {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gr-pc__pagination-dots {
    letter-spacing: 1px;
    color: #999;
    font-size: 12px;
    margin: 0 2px;
}

.gr-pc__pagination-btn--number {
    font-weight: 500;
}

/* =====================
   RESPONSIVE (Mobile Mode)
   ===================== */

/* Ocultar elementos móviles en desktop por defecto */
.gr-pc__mobile-filter-btn,
.gr-pc__filters-mobile-header,
.gr-pc__filters-mobile-footer {
    display: none;
}

/* Spinner Styles */
.gr-pc__spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    border-top-color: #fff;
    animation: gr-pc-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.gr-pc__spinner.is-hidden {
    display: none;
}

@keyframes gr-pc-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {

    /* 1. Header Layout Adjustments */
    .gr-pc__header {
        align-items: center;
        gap: 12px;
    }

    .gr-pc__header-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* 2. Show Mobile Trigger */
    .gr-pc__mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border: 1px solid #d1d5e6;
        background: #fff;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        color: #333;
    }

    /* 3. Off-Canvas Modal (Sidebar Transformation) */
    .gr-pc__sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        padding: 0;
        box-shadow: none;
        border: none;
    }

    .gr-pc__sidebar.is-open {
        transform: translateX(0);
    }

    /* Mobile Header */
    .gr-pc__filters-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #eee;
        background: #fff;
    }

    .gr-pc__filters-mobile-title {
        font-weight: 700;
        font-size: 18px;
        color: #333;
    }

    .gr-pc__filters-close {
        background: none;
        border: none;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
        color: #666;
    }

    /* Scrollable Content Area */
    .gr-pc__filters-scroll-area {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        padding-bottom: 80px;
        /* Space for sticky footer */
    }

    /* Mobile Footer */
    .gr-pc__filters-mobile-footer {
        display: flex;
        padding: 16px;
        background: #fff;
        border-top: 1px solid #eee;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 10;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }

    .gr-pc__filters-show-btn {
        width: 100%;
        background: #f8941d;
        /* Yellow */
        color: #fff;
        border: none;
        padding: 14px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 700;
        text-transform: uppercase;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s;
    }

    .gr-pc__filters-show-btn:hover {
        background: #e6830d;
    }

    .gr-pc__filters-show-btn:disabled {
        opacity: 0.7;
        cursor: wait;
    }

    /* Hide Sort on Mobile (optional) */
    .gr-pc__sort-form,
    .gr-pc__header-pages {
        display: none;
    }

    /* Product grid 2 cols mobile */
    .gr-pc__products {
        grid-template-columns: repeat(2, 1fr);
    }

    .gr-pc__product {
        grid-template-columns: 1fr;
    }
}