/* ============================================
   CLUBALMACÉN – STORE.CSS
   Perfil de comercio · Catálogo · Tienda online
   ============================================ */

/* ---- Perfil ---- */
.perfil-cover {
    position: relative;
    height: 140px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b0000 100%);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    cursor: pointer;
}
.perfil-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.perfil-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex-direction: column;
    gap: 6px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}
.perfil-cover-placeholder i { font-size: 28px; }
.perfil-cover-edit-btn {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: rgba(0,0,0,0.45);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}
.perfil-cover-edit-btn:hover { background: rgba(0,0,0,0.65); }

.perfil-logo-area {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 0 20px;
    margin-top: -36px;
    position: relative;
    z-index: 2;
}
.perfil-logo-wrap {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    border: 3px solid white;
    background: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-light);
    transition: transform 0.2s;
}
.perfil-logo-wrap:hover { transform: scale(1.05); }
.perfil-logo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.perfil-name-row { padding-bottom: 8px; flex: 1; }
.perfil-name-row h2 { font-size: 20px; font-weight: 800; margin: 0 0 2px; }
.perfil-name-row .perfil-tipo { font-size: 12.5px; color: var(--text-light); }

.perfil-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px 16px;
}
.perfil-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.perfil-badge.open { background: rgba(0,200,83,0.12); color: #00a848; }
.perfil-badge.closed { background: rgba(224,0,0,0.08); color: var(--primary); }
.perfil-badge.envio { background: rgba(33,150,243,0.1); color: #1565c0; }
.perfil-badge.noenvio { background: rgba(0,0,0,0.05); color: #666; }

.perfil-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 16px 0;
}
.perfil-form-grid .full { grid-column: 1 / -1; }

.toggle-switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.toggle-switch-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; font-weight: 600; }
.toggle-sublabel { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.3s;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ---- Catálogo ---- */
.oferta-form {
    background: #f8f8f8;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1.5px dashed #ddd;
}
.oferta-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.oferta-form-grid .full { grid-column: 1 / -1; }

.oferta-img-preview {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    display: none;
    margin-bottom: 8px;
}
.oferta-img-placeholder {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    border: 2px dashed #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 8px;
}
.oferta-img-placeholder:hover { border-color: var(--primary); background: rgba(224,0,0,0.03); }
.oferta-img-placeholder i { font-size: 26px; }

.ofertas-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.oferta-admin-item {
    display: flex;
    gap: 14px;
    align-items: center;
    background: white;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 14px;
    padding: 12px 14px;
    transition: box-shadow 0.2s;
}
.oferta-admin-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.oferta-admin-img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
}
.oferta-admin-img img { width: 100%; height: 100%; object-fit: cover; }
.oferta-admin-info { flex: 1; min-width: 0; }
.oferta-admin-info h4 { margin: 0 0 3px; font-size: 14px; font-weight: 700; }
.oferta-admin-info p { margin: 0; font-size: 12px; color: var(--text-light); }
.oferta-admin-price { font-size: 16px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.oferta-admin-actions { display: flex; gap: 4px; }
.btn-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s;
}
.btn-icon.edit { background: rgba(33,150,243,0.1); color: #1565c0; }
.btn-icon.edit:hover { background: rgba(33,150,243,0.2); }
.btn-icon.delete { background: rgba(224,0,0,0.08); color: var(--primary); }
.btn-icon.delete:hover { background: rgba(224,0,0,0.18); }
.btn-icon.toggle { background: rgba(0,200,83,0.1); color: #00a848; }
.btn-icon.toggle.off { background: rgba(0,0,0,0.05); color: #999; }

/* ---- Tiendas ---- */
.tiendas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.tienda-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: transform 0.22s, box-shadow 0.22s;
}
.tienda-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.11);
}
.tienda-card-cover { height: 100px; background: linear-gradient(135deg, var(--primary), #8b0000); overflow: hidden; }
.tienda-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.tienda-card-body { padding: 8px 14px 14px; display: flex; gap: 10px; align-items: flex-start; }
.tienda-card-logo {
    width: 48px; height: 48px;
    border-radius: 10px;
    border: 2px solid white;
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-top: -20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
    flex-shrink: 0;
}
.tienda-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.tienda-card-info { flex: 1; min-width: 0; }
.tienda-card-info h4 { margin: 0 0 2px; font-size: 14px; font-weight: 700; }
.tienda-card-info p { margin: 0 0 6px; font-size: 12px; color: var(--text-light); }
.tienda-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tienda-card-tag { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }

/* ---- Tienda individual ---- */
.tienda-header {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}
.tienda-cover { height: 130px; background: linear-gradient(135deg, var(--primary), #8b0000); overflow: hidden; }
.tienda-cover img { width: 100%; height: 100%; object-fit: cover; }
.tienda-info { padding: 0 20px 16px; }
.tienda-logo-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-top: -32px;
    margin-bottom: 10px;
}
.tienda-logo {
    width: 64px; height: 64px;
    border-radius: 14px;
    border: 3px solid white;
    background: white;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    overflow: hidden;
}
.tienda-logo img { width: 100%; height: 100%; object-fit: cover; }
.tienda-nombre-bloque { flex: 1; }
.tienda-nombre-bloque h3 { margin: 0 0 2px; font-size: 18px; font-weight: 800; }
.tienda-nombre-bloque p { margin: 0; font-size: 12px; color: var(--text-light); }
.tienda-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tienda-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 16px;
    font-weight: 600;
}
.tienda-tag.verde { background: rgba(0,200,83,0.1); color: #00a848; }
.tienda-tag.rojo { background: rgba(224,0,0,0.08); color: var(--primary); }
.tienda-tag.azul { background: rgba(33,150,243,0.1); color: #1565c0; }
.tienda-tag.gris { background: rgba(0,0,0,0.05); color: #666; }
.tienda-desc { font-size: 13px; color: var(--text-light); margin-top: 8px; }

.cat-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    padding-bottom: 4px;
}
.cat-filters::-webkit-scrollbar { display: none; }
.cat-filter-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid rgba(0,0,0,0.1);
    background: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}
.cat-filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.producto-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.22s, box-shadow 0.22s;
}
.producto-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.producto-img {
    height: 110px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    position: relative;
    overflow: hidden;
}
.producto-img img { width: 100%; height: 100%; object-fit: cover; }
.producto-oferta-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--gradient-primary);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}
.producto-body { padding: 10px 12px 12px; }
.producto-nombre { font-size: 13px; font-weight: 700; margin: 0 0 3px; }
.producto-detalle { font-size: 11px; color: var(--text-light); margin: 0 0 6px; }
.producto-precio-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.producto-precio { font-size: 16px; font-weight: 800; color: var(--primary); }
.producto-precio-original { font-size: 11px; color: #aaa; text-decoration: line-through; }
.producto-add-btn {
    width: 100%;
    padding: 6px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.producto-add-btn:hover { opacity: 0.85; }

/* ---- Carrito ---- */
.carrito-fab {
    position: fixed;
    bottom: 100px;
    right: 28px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 22px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(224,0,0,0.3);
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 800;
}
.carrito-fab.visible { display: flex; }
.carrito-fab:hover { transform: translateY(-2px); }
.carrito-count {
    background: white;
    color: var(--primary);
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.carrito-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
    z-index: 850;
    display: none;
    max-height: 75vh;
    overflow-y: auto;
    padding: 20px;
    animation: slideUp 0.3s ease;
}
.carrito-panel.open { display: block; }
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.carrito-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.carrito-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.carrito-item-emoji { font-size: 28px; flex-shrink: 0; }
.carrito-item-info { flex: 1; }
.carrito-item-info h4 { margin: 0 0 2px; font-size: 14px; font-weight: 700; }
.carrito-item-info p { margin: 0; font-size: 12px; color: var(--text-light); }
.carrito-qty-ctrl { display: flex; align-items: center; gap: 6px; }
.carrito-qty-btn {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1.5px solid rgba(0,0,0,0.12);
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}
.carrito-qty { font-size: 14px; font-weight: 700; min-width: 20px; text-align: center; }
.carrito-item-total { font-size: 14px; font-weight: 800; color: var(--primary); }

.carrito-total-row {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 2px solid rgba(0,0,0,0.08);
}
.carrito-total-row .label { font-size: 14px; font-weight: 700; }
.carrito-total-row .value { font-size: 22px; font-weight: 800; color: var(--primary); }
.carrito-envio-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-light);
}
.carrito-checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.carrito-checkout-btn:hover { opacity: 0.85; }

.carrito-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 840;
    display: none;
    backdrop-filter: blur(2px);
}
.carrito-overlay.open { display: block; }

/* ---- Modal producto ---- */
.producto-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1050;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.producto-modal-overlay.open { display: flex; }
.producto-modal {
    background: white;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 520px;
    padding: 24px;
    animation: slideUp 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}
.producto-modal-img {
    width: 100%;
    height: 180px;
    border-radius: 14px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    margin-bottom: 16px;
    overflow: hidden;
}
.producto-modal-img img { width: 100%; height: 100%; object-fit: cover; }
.producto-modal-nombre { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.producto-modal-desc { font-size: 14px; color: var(--text-light); margin-bottom: 14px; }
.producto-modal-precio-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.producto-modal-precio { font-size: 28px; font-weight: 800; color: var(--primary); }
.producto-modal-original { font-size: 16px; color: #aaa; text-decoration: line-through; }
.producto-modal-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8f8f8;
    border-radius: 12px;
    margin-bottom: 16px;
}
.modal-qty-ctrl { display: flex; align-items: center; gap: 12px; }
.modal-qty-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 16px;
    cursor: pointer;
}
.modal-qty-val { font-size: 18px; font-weight: 800; min-width: 24px; text-align: center; }
.producto-modal-add-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.producto-modal-add-btn:hover { opacity: 0.85; }

/* ---- Suscripción ---- */
.suscripcion-panel {
    text-align: center;
    padding: 16px 0;
}
.suscripcion-title { font-size: 14px; color: var(--text-light); margin-bottom: 4px; }
.suscripcion-amount { font-size: 36px; font-weight: 800; color: var(--primary); }
.suscripcion-subtitle { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.suscripcion-breakdown { text-align: left; margin-bottom: 16px; }
.suscripcion-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
}
.suscripcion-row.total {
    border-bottom: none;
    padding-top: 10px;
    font-weight: 700;
    font-size: 15px;
}
.suscripcion-status {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}
.suscripcion-status.pending { background: rgba(255,152,0,0.1); color: var(--warning); }
.suscripcion-status.ok { background: rgba(0,200,83,0.1); color: var(--success); }
.suscripcion-pay-btn {
    margin-top: 12px;
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.suscripcion-pay-btn:hover { opacity: 0.85; }

@media (max-width: 600px) {
    .perfil-form-grid { grid-template-columns: 1fr; }
    .oferta-form-grid { grid-template-columns: 1fr; }
    .productos-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tiendas-grid { grid-template-columns: 1fr; }
    .carrito-panel { padding: 16px; }
    .producto-modal { padding: 16px; }
}