@import url('variables.css');

/* ============================================================
   COMPONENTS - Tarjetas, Botones, Badges
   ============================================================ */

/* --- Product Card --- */
.p-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.p-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.p-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-6px);
}
.p-card:hover::after { opacity: 1; }

.p-card-img {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.p-card-img img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    transition: transform 0.4s ease;
}
.p-card:hover .p-card-img img { transform: scale(1.05); }

.p-card-info { flex-grow: 1; }

.p-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.p-card-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--brand-secondary);
    margin-bottom: 0.5rem;
}

.p-card .stock-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}
.stock-badge.in-stock { background: #dcfce7; color: #16a34a; }
.stock-badge.low-stock { background: #fef3c7; color: #d97706; }

/* --- Buttons --- */
.btn-buy {
    background: var(--brand-primary);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-buy::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}
.btn-buy:hover::before { transform: translateX(100%); }
.btn-buy:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
    transform: translateY(-1px);
}
.btn-buy:active { transform: translateY(0); }

/* --- Badge Offer --- */
.badge-offer {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 0.65rem;
    z-index: 10;
    letter-spacing: 0.5px;
}

/* --- Category Header Card --- */
.cat-header-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    margin-bottom: 2rem;
}
.cat-header-card h1 { margin: 0; font-size: 2rem; color: var(--brand-secondary); }

/* --- Sidebar Filter Card --- */
.filter-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
}
.filter-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-soft);
    letter-spacing: 0.5px;
}

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 3rem; }
.pagination a {
    width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; text-decoration: none; font-weight: 800; font-size: 0.9rem;
    border: 2px solid var(--border-soft); color: var(--text-main); transition: all 0.2s;
}
.pagination a:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.pagination a.active { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }

/* --- Contact Form --- */
.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #f1f5f9;
    border-radius: 10px;
    font-family: inherit;
    outline: none;
    transition: 0.2s;
    background: #f8fafc;
}
.form-input:focus { border-color: var(--brand-primary); background: #fff; }

/* --- Drawer Items --- */
.drawer-item-link {
    display: block; padding: 1.1rem 1.5rem; font-weight: 700;
    border-bottom: 1px solid #eee; text-decoration: none; color: var(--text-main);
    transition: background 0.15s;
}
.drawer-item-link:hover { background: #f8fafc; color: var(--brand-primary); }

/* --- Admin Quick Styles --- */
.btn-admin { padding: 0.7rem 1.5rem; border-radius: 8px; font-weight: 700; font-size: 0.8rem; cursor: pointer; border: none; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-admin-primary { background: var(--brand-primary); color: white; }
.btn-admin-primary:hover { background: #ea580c; }
.btn-admin-danger { background: #dc2626; color: white; }
.btn-admin-danger:hover { background: #b91c1c; }
