/* General Store Layout Fixes */
.container {
    max-width: 95% !important;
}

.tienda-caja {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.tienda-col-primary {
    flex: 3;
}

.tienda-col-secondary {
    flex: 1;
    min-width: 280px;
}

/* Rounded Inputs & Buttons */
#search-desc,
#filter-brand {
    border-radius: 10px;
    border: 1px solid var(--border-color, #ccc);
    padding: 8px !important;
    /* Override inline padding if needed */
}

#sort-price-asc,
#sort-price-desc {
    border-radius: 20px;
    border: 1px solid var(--border-color, #ccc);
    background: white;
    margin-bottom: 5px;
    transition: all 0.2s;
}

#sort-price-asc:hover,
#sort-price-desc:hover {
    background: var(--bg-color, #f0f4f8);
    border-color: var(--accent, #0284c7);
}

@media (max-width: 768px) {
    .tienda-caja {
        flex-direction: column-reverse;
        /* Filters below products on mobile */
    }

    .tienda-col-secondary {
        width: 100%;
        min-width: 0;
    }
}

/* Grid de Productos - Centrado y Responsivo */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 180px);
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.producto-card {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 15px;
    padding: 12px;
    width: 180px;
    height: 280px;
    margin: 0 !important;
    /* Altura fija solicitada */
    flex-grow: 0;
    flex-shrink: 0;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* Mantiene el nombre y precio abajo */
    overflow: hidden;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.producto-card img {
    width: 100%;
    height: 125px;
    /* Ajustada para caber en la altura de 280px */
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8fafc;
    flex-shrink: 0;
}

.producto-card .nombre {
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.producto-card .precio {
    font-weight: 800;
    color: var(--text-color);
    font-size: 1.2rem;
}

/* Modal Layout Structure */
.detalle-contenido {
    display: flex;
    gap: 40px;
}

.detalle-imagenes {
    flex: 1;
    min-width: 0;
    /* Prevents flex overflow */
}

.detalle-info {
    flex: 1;
    min-width: 0;
}

.detalle-main-img-container {
    width: 100%;
    height: 400px;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color, #e2e8f0);
}

.detalle-main-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.detalle-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.detalle-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.2s;
}

.detalle-thumb:hover {
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .detalle-contenido {
        flex-direction: column;
        gap: 20px;
    }

    .detalle-main-img-container {
        height: 300px;
    }
}

/* Modal Styles - High Contrast & Premium */
.producto-modal {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    padding: 20px;
}

.producto-detalle {
    background: var(--card-bg, white);
    color: var(--text-color, #333);
    max-width: 900px;
    width: 100%;
    max-height: 95vh;
    border-radius: 20px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color, #ddd);
    padding: 30px;
}

.dark-mode .producto-detalle {
    background: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}

/* Detail Elements */
.detalle-titulo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent, #0284c7);
    margin-bottom: 10px;
    line-height: 1.2;
}

.dark-mode .detalle-titulo {
    color: #7dd3fc;
}

.detalle-subtitulo {
    font-size: 1.3rem;
    color: #64748b;
    margin-bottom: 25px;
    font-weight: 400;
}

.dark-mode .detalle-subtitulo {
    color: #94a3b8;
}

.detalle-info div {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.detalle-info strong {
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-right: 5px;
}

.dark-mode .detalle-info strong {
    color: #38bdf8;
}

/* Description */
.detalle-descripcion {
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.03);
    border-left: 5px solid var(--accent);
    border-radius: 8px;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
}

.dark-mode .detalle-descripcion {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

/* THE PRICE - MASSIVE & VISIBLE */
.detalle-precio-box {
    margin: 30px 0;
    padding: 30px;
    background: rgba(2, 132, 199, 0.08);
    border: 3px solid var(--accent, #0284c7);
    border-radius: 20px;
    text-align: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

.dark-mode .detalle-precio-box {
    background: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.15);
}

.detalle-precio-final {
    font-size: 3.5rem !important;
    /* Balanced large size */
    font-weight: 900 !important;
    color: var(--accent, #0284c7) !important;
    display: block;
    line-height: 1;
    margin: 0;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
}

.dark-mode .detalle-precio-final {
    color: #7dd3fc !important;
    text-shadow: 0 0 30px rgba(125, 211, 252, 0.5);
}

/* Buttons and Links */
.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: #22c55e;
    color: white !important;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s;
    margin-top: 15px;
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.4);
    border: none;
    cursor: pointer;
}

.btn-whatsapp:hover {
    background: #16a34a;
    transform: translateY(-3px);
}

.btn-copy-link {
    margin-top: 12px;
    padding: 15px;
    width: 100%;
    background: #334155;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-copy-link:hover {
    background: #1e293b;
}

.btn-copy-link.copied {
    background: #059669 !important;
}

.url-display-text {
    background: rgba(0, 0, 0, 0.05);
    padding: 12px;
    margin-top: 20px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    /* Matches button text size */
    color: var(--accent);
    border: 1px dashed var(--border-color);
    text-align: center;
    user-select: all;
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* Close Button */
.detail-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.detail-close-btn:hover {
    background: #e11d48;
    transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 600px) {
    .detalle-titulo {
        font-size: 1.6rem;
    }

    .detalle-precio-final {
        font-size: 2rem !important;
    }

    .producto-detalle {
        padding: 20px;
    }
}