/* ==========================================================================
   Aquí Cocina Mamá - Panel de Control Sencillo para Sandra
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #D9480F;
    --primary-hover: #BF360C;
    --success: #2B8A3E;
    --success-hover: #237032;
    --danger: #E03131;
    --danger-hover: #C92A2A;
    --bg: #F8F9FA;
    --surface: #FFFFFF;
    --text: #212529;
    --text-muted: #6C757D;
    --border: #DEE2E6;
    --radius: 12px;
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.admin-brand-logo {
    height: 46px;
    max-height: 46px;
    width: auto;
    object-fit: contain;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 16px;
}

/* Login Mobile Friendly */
.login-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 12px 14px 120px;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.login-card {
    background: var(--surface);
    width: 100%;
    max-width: 380px;
    margin: 8px auto 30px;
    padding: 22px 18px;
    border-radius: 18px;
    box-shadow: 0 8px 26px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 14px;
}

.login-icon {
    font-size: 3rem;
    display: inline-block;
    margin-bottom: 8px;
}

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.large-input {
    font-size: 1.2rem !important;
    padding: 14px 16px !important;
    text-align: center;
    letter-spacing: 2px;
}

/* Header */
.admin-header {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-emoji {
    font-size: 2.2rem;
}

.admin-brand h1 {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
}

.admin-brand span {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Layout */
.admin-container {
    max-width: 1100px;
    margin: 28px auto;
    padding: 0 20px 60px;
}

/* Action Banner */
.action-banner {
    background: linear-gradient(135deg, #FFF6EE, #FFEAD4);
    border: 2px solid #FFD8A8;
    border-radius: 18px;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .action-banner {
        flex-direction: column;
        text-align: center;
    }
}

.action-banner h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #A61E4D;
    margin-bottom: 4px;
}

.action-banner p {
    color: #495057;
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--success);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(43, 138, 62, 0.25);
}

.btn-primary:hover {
    background: var(--success-hover);
    transform: translateY(-2px);
}

.btn-large {
    padding: 14px 24px;
    font-size: 1.1rem;
    border-radius: 50px;
}

.btn-block {
    width: 100%;
}

.btn-secondary {
    background: #E9ECEF;
    color: var(--text);
}

.btn-secondary:hover {
    background: #DEE2E6;
}

.btn-logout {
    background: #FFE3E3;
    color: var(--danger);
}

.btn-logout:hover {
    background: #FFC9C9;
}

.btn-edit {
    background: #E7F5FF;
    color: #1971C2;
    flex: 1;
}

.btn-edit:hover {
    background: #D0EBFF;
}

.btn-toggle {
    background: #FFF9DB;
    color: #F59F00;
    flex: 1;
}

.btn-toggle:hover {
    background: #FFF3BF;
}

.btn-delete {
    background: #FFE3E3;
    color: var(--danger);
}

.btn-delete:hover {
    background: #FFC9C9;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-success {
    background: #EBFBEE;
    color: var(--success);
    border: 1px solid #D3F9D8;
}

.alert-error {
    background: #FFE3E3;
    color: var(--danger);
    border: 1px solid #FFC9C9;
}

/* Products Section */
.section-title-box {
    margin-bottom: 20px;
}

.section-title-box h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.help-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--surface);
    border-radius: 16px;
    border: 1.5px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.product-card.paused {
    opacity: 0.75;
    border-color: #FFA94D;
    background: #FFF9F2;
}

.product-img-box {
    position: relative;
    width: 100%;
    height: 180px;
    background: #F1F3F5;
}

.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-status {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.badge-active {
    background: rgba(43, 138, 62, 0.95);
    color: #FFF;
}

.badge-paused {
    background: rgba(224, 49, 49, 0.95);
    color: #FFF;
}

.badge-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #FFF;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-cat {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.product-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.product-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
    flex-grow: 1;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 14px;
}

.product-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Modal Form */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--surface);
    width: 100%;
    max-width: 560px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    max-height: 92vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 700;
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 72, 15, 0.15);
}

.form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #F8F9FA;
    padding: 12px;
    border-radius: var(--radius);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.link-back {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}
.link-back:hover {
    color: var(--primary);
}
