/* ==========================================================================
   TAMCA TIENDA PREMIUM UX/UI EXTENSIONS
   Buscador Predictivo, Quick Cart Offcanvas, Back to Top, Quick View Modal
   ========================================================================== */

/* --- Back to Top Floating Button --- */
.tamca-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: #1a2224;
    color: #F6CD2E;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid #F6CD2E;
}
.tamca-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.tamca-back-to-top:hover {
    background-color: #F6CD2E;
    color: #1a2224;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* --- Buscador Predictivo Flotante --- */
.tamca-predictive-search-wrap {
    position: relative;
    width: 100%;
}
.tamca-predictive-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);
    z-index: 1060;
    overflow: hidden;
    animation: tamcaFadeSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tamcaFadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.tamca-predictive-header {
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tamca-predictive-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
}
.tamca-predictive-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none !important;
    color: #1e293b !important;
    transition: background-color 0.15s ease;
}
.tamca-predictive-item:last-child {
    border-bottom: none;
}
.tamca-predictive-item:hover,
.tamca-predictive-item:focus {
    background-color: #fffbeb;
}
.tamca-predictive-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: contain;
    background: #f8fafc;
    padding: 2px;
    border: 1px solid #e2e8f0;
}
.tamca-predictive-info {
    flex: 1;
    min-width: 0;
}
.tamca-predictive-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tamca-predictive-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #64748b;
}
.tamca-predictive-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
.tamca-predictive-footer a {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a2224;
    text-decoration: none;
}
.tamca-predictive-footer a:hover {
    color: #d97706;
}

/* --- Offcanvas Mini-Cart Drawer --- */
.tamca-quickcart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 92vw);
    background: #ffffff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 10500;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.tamca-quickcart-drawer.is-open {
    transform: translateX(0);
}
.tamca-quickcart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 10490;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}
.tamca-quickcart-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}
.tamca-quickcart-header {
    padding: 16px 20px;
    background: #1a2224;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tamca-quickcart-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tamca-quickcart-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.tamca-quickcart-close:hover {
    opacity: 1;
    color: #F6CD2E;
}
.tamca-quickcart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.tamca-quickcart-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}
.tamca-quickcart-item-img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.tamca-quickcart-item-details {
    flex: 1;
    min-width: 0;
}
.tamca-quickcart-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.3;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none !important;
}
.tamca-quickcart-item-code {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
}
.tamca-quickcart-footer {
    padding: 18px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.tamca-quickcart-btn-primary {
    background: #F6CD2E;
    color: #1a2224;
    border: 2px solid #1a2224;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(246, 205, 46, 0.4);
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.tamca-quickcart-btn-primary:hover {
    background: #1a2224;
    color: #F6CD2E;
}

/* --- Quick View Modal Button & Styling --- */
.tamca-quickview-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #1a2224;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 5;
}
.tamca-product-card:hover .tamca-quickview-btn {
    opacity: 1;
    transform: scale(1);
}
.tamca-quickview-btn:hover {
    background: #1a2224;
    color: #F6CD2E;
}
@media (max-width: 768px) {
    .tamca-quickview-btn {
        opacity: 0.85;
        transform: scale(1);
    }
}

/* --- Premium Filter Pills Toolbar --- */
.tamca-filter-pills-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 2px 14px 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.tamca-filter-pills-bar::-webkit-scrollbar {
    height: 4px;
}
.tamca-filter-pills-bar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.tamca-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 9999px;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}
.tamca-pill-btn i {
    font-size: 0.75rem;
    opacity: 0.75;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.tamca-pill-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}
.tamca-pill-btn:hover i {
    opacity: 1;
    transform: scale(1.1);
}
.tamca-pill-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Active Pill State — TAMCA Gold Signature */
.tamca-pill-btn.is-active {
    background: linear-gradient(135deg, #FFD026 0%, #F5C000 100%);
    color: #1a2224 !important;
    border-color: #e5b300;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(245, 192, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}
.tamca-pill-btn.is-active i {
    color: #1a2224;
    opacity: 1;
}

