/* =======================================================
   QUEPEDIMOS - DESIGN SYSTEM V2
   ======================================================= */

body:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) {

    /* Colores */

    --color-primary: #2E7D32;
    --color-primary-hover: #256628;

    --color-background: #F7F8FA;
    --color-surface: #FFFFFF;

    --color-text: #222222;
    --color-text-light: #666666;

    --color-border: #E5E7EB;

    --color-success: #22C55E;
    --color-danger: #DC2626;

    /* Bordes */

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    /* Sombras */

    --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,.08);

    /* Espaciados */

    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;

}/* =======================================================
   BASE SOLO PARA CLIENTE Y ACCESO
   ======================================================= */

/* main.js sets inline display:none/block when routing screens.
   :where keeps selector specificity unchanged; operational screens use style.css.
   Shared logo rules below target the header only, never operational controls. */
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))), :where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) * {
    box-sizing: border-box;
}

html:has(#auth-ui:not([style*="display: none"]), #customer-dashboard:not([style*="display: none"])) {
    scroll-behavior: smooth;
}

body:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) h1,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) h2,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) h3,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) h4,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) p {
    margin-top: 0;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) button,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) input,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) select,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) textarea {
    font: inherit;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) button {
    border: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) button:hover {
    transform: translateY(-1px);
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) input,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) select,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 12px 14px;
    outline: none;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) input:focus,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) select:focus,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}
body:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}
/* =======================================================
   PANEL DEL CLIENTE
   ======================================================= */

#customer-dashboard{

    max-width:1100px;
    margin:40px auto;
    padding:30px;

}

#customer-browser,
#customer-order-form,
#customer-payment-step,
#customer-orders-section{

    background:white;

    border-radius:18px;

    box-shadow:var(--shadow-md);

    padding:32px;

    margin-bottom:28px;

}
/* =======================================================
   INICIO DEL CLIENTE
   ======================================================= */

#customer-browser {
    text-align: left;
}

#customer-browser h2 {
    margin-bottom: 8px;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

#customer-browser h2::after {
    content: "Elegí tu ciudad y encontrá dónde pedir.";
    display: block;
    margin-top: 10px;
    color: var(--color-text-light);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0;
}

#cust-city-filter {
    display: block;
    width: 100% !important;
    max-width: 520px;
    min-height: 52px;
    margin: 24px 0 8px;
    padding: 0 16px !important;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md) !important;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

#customer-stores-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 16px !important;
    padding: 24px 0 0 !important;
}

@media (max-width: 640px) {
    body:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) {
        padding: 12px;
    }

    #customer-dashboard {
        margin: 20px auto;
        padding: 0;
    }

    #customer-browser,
    #customer-order-form,
    #customer-payment-step,
    #customer-orders-section {
        padding: 22px 18px;
        border-radius: 16px;
    }

    #customer-stores-list {
        grid-template-columns: 1fr !important;
    }
}
/* =======================================================
   INICIO DEL CLIENTE
   ======================================================= */

#customer-browser {
    text-align: left;
}

#customer-browser h2 {
    margin-bottom: 8px;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

#customer-browser h2::after {
    content: "Elegí tu ciudad y encontrá dónde pedir.";
    display: block;
    margin-top: 10px;
    color: var(--color-text-light);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0;
}

#cust-city-filter {
    display: block;
    width: 100% !important;
    max-width: 520px;
    min-height: 52px;
    margin: 24px 0 8px;
    padding: 0 16px !important;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md) !important;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

#customer-stores-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 16px !important;
    padding: 24px 0 0 !important;
}

@media (max-width: 640px) {
    body:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) {
        padding: 12px;
    }

    #customer-dashboard {
        margin: 20px auto;
        padding: 0;
    }

    #customer-browser,
    #customer-order-form,
    #customer-payment-step,
    #customer-orders-section {
        padding: 22px 18px;
        border-radius: 16px;
    }

    #customer-stores-list {
        grid-template-columns: 1fr !important;
    }
}
/* =======================================================
   INFORMACIÓN DE SESIÓN
   Oculta datos técnicos que no ayudan al usuario
   ======================================================= */

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) #user-display-uid,
:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) #user-display-claims {
    display: none !important;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) #user-info {
    max-width: 1100px;
    margin: 16px auto 0 !important;
    padding: 12px 16px;
    background: transparent;
    text-align: right;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) #user-info h3 {
    display: none;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) #user-display-email {
    margin: 0 0 10px;
    color: var(--color-text-light);
    font-size: 0.85rem;
}

:where(body:has(:is(#auth-ui, #customer-dashboard):not([style*="display: none"]))) #user-info button {
    width: auto;
    margin: 0 0 0 8px;
    padding: 9px 14px;
    font-size: 0.85rem;
}
/* =======================================================
   ELECCIÓN DE CIUDAD
   ======================================================= */

#customer-browser {
    max-width: 760px;
    margin: 0 auto;
}

#customer-browser h2 {
    margin-bottom: 6px;
    text-align: center;
}

#customer-browser h2::after {
    text-align: center;
}

#customer-browser > div:first-of-type {
    max-width: 520px;
    margin: 28px auto 8px !important;
}

#cust-city-filter {
    width: 100% !important;
    min-height: 56px;
    margin: 0;
    padding: 0 18px !important;
    border: 1px solid var(--color-border);
    border-radius: 14px !important;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

#cust-city-filter:hover {
    border-color: #cbd5e1;
}

#cust-city-filter:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.12);
}

#customer-stores-list:empty::before {
    content: "Elegí una ciudad para ver los comercios disponibles.";
    display: block;
    grid-column: 1 / -1;
    padding: 28px 16px;
    color: var(--color-text-light);
    text-align: center;
}
#customer-access-actions { margin-bottom: 16px; }
#customer-access-actions button {
    min-height: 48px;
    padding: 12px 18px;
    background: #FF681F;
    color: #172b24;
    font-weight: 650;
}
#customer-access-actions button:focus-visible {
    outline: 3px solid #245d35;
    outline-offset: 3px;
}
/* Product presentation only in the customer's catalog. Purchase controls stay native. */
#customer-order-form #customer-catalog { max-width: 760px !important; }
#customer-catalog #catalog-container {
    display: grid;
    gap: 14px;
}
#customer-catalog #catalog-container .catalog-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    margin: 0;
    padding: 14px;
    gap: 14px;
    border: 1px solid #dfe5dc;
    border-radius: 18px;
    background: #fff;
    color: #172b24;
    text-align: left;
    box-shadow: 0 3px 12px #172b2408;
}
#customer-catalog #catalog-container .catalog-img {
    display: block;
    width: 100%;
    max-width: none;
    height: 156px;
    margin: 0;
    border-radius: 12px;
    object-fit: contain;
    background: #f4f7f2;
}
#customer-catalog #catalog-container .product-no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    border-radius: 12px;
    border: 1px dashed #cbd8ca;
    background: #f4f7f2;
    color: #52635a;
    font-size: 12px;
}
#customer-catalog #catalog-container .product-content { flex: 1; min-width: 0; }
#customer-catalog #catalog-container .product-code {
    color: #52635a;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
#customer-catalog #catalog-container .product-name {
    margin: 4px 0 8px;
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: -.3px;
    font-weight: 750;
    overflow-wrap: anywhere;
}
#customer-catalog #catalog-container .product-bonus {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 8px;
    border-left: 3px solid #16B84E;
    border-radius: 4px;
    background: #eef8ef;
    color: #245d35;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.5;
}
#customer-catalog #catalog-container .product-price {
    display: block;
    margin-bottom: 12px;
    font-size: 23px;
    line-height: 1.25;
    font-weight: 750;
    overflow-wrap: anywhere;
}
#customer-catalog #catalog-container .product-quantity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e5ebe1;
    font-size: 14px;
    font-weight: 650;
}
#customer-catalog #catalog-container .product-quantity input {
    width: 88px;
    max-width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #FF681F;
    border-radius: 10px;
    background: #FF681F;
    color: #172b24;
    font-size: 16px;
    font-weight: 700;
}
#customer-catalog #catalog-container .product-quantity input:focus-visible {
    outline: 3px solid #245d35;
    outline-offset: 3px;
    box-shadow: none;
}
@media (min-width: 480px) and (max-width: 899px) {
    #customer-catalog #catalog-container .catalog-item { flex-direction: row; align-items: flex-start; }
    #customer-catalog #catalog-container .catalog-img { flex: 0 0 112px; width: 112px; height: 112px; }
    #customer-catalog #catalog-container .product-no-photo { flex: 0 0 80px; min-height: 80px; }
}
@media (min-width: 900px) {
    #customer-catalog #catalog-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Store cards only in the customer's public store selector. */
#customer-stores-list .store-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 96px;
    padding: 16px;
    border: 1px solid #dfe5dc;
    border-radius: 18px;
    background: #fff;
    color: #172b24;
    text-align: left;
    box-shadow: 0 3px 12px #172b2408;
    cursor: pointer;
}
#customer-stores-list .store-card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    height: 52px;
    border-radius: 14px;
    background: #16B84E;
    color: #172b24;
}
#customer-stores-list .store-card-content { flex: 1; min-width: 0; }
#customer-stores-list .store-card-name {
    display: block;
    font-size: 17px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: -.25px;
    overflow-wrap: anywhere;
}
#customer-stores-list .store-card-status {
    display: block;
    margin-top: 6px;
    color: #52635a;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}
/* Availability modifiers are set from the store's availability document data. */
#customer-stores-list .store-card-status:is(.store-card-status--open, .store-card-status--closed) {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
#customer-stores-list .store-card-status:is(.store-card-status--open, .store-card-status--closed)::before {
    content: "";
    flex: 0 0 8px;
    height: 8px;
    border-radius: 50%;
}
#customer-stores-list .store-card-status--open::before { background: #16B84E; }
#customer-stores-list .store-card-status--closed::before { background: #858e88; }
#customer-stores-list .store-card-status--open { color: #146b32; }
#customer-stores-list .store-card-status--closed { color: #4d5851; }
#customer-stores-list .store-card-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    height: 32px;
    border-radius: 50%;
    background: #FF681F;
    color: #172b24;
    font-size: 20px;
    line-height: 1;
}
#customer-stores-list .store-card:hover {
    border-color: #16B84E;
    background: #f9fcf8;
    box-shadow: 0 5px 16px #172b2410;
    transform: none;
}
#customer-stores-list .store-card:focus-visible {
    outline: 3px solid #245d35;
    outline-offset: 3px;
}
@media (max-width: 359px) {
    #customer-stores-list .store-card { padding: 14px 12px; gap: 10px; }
    #customer-stores-list .store-card-icon { flex-basis: 44px; height: 44px; }
    #customer-stores-list .store-card-arrow { flex-basis: 28px; height: 28px; }
}

/* Availability in the selected public catalog; closed stores remain browsable. */
#customer-order-form .customer-store-availability {
    margin: 10px auto 14px;
    padding: 12px 14px;
    border: 1px solid #c5d0c8;
    border-left: 4px solid #858e88;
    border-radius: 12px;
    background: #f4f6f4;
    color: #354139;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
    text-align: left;
}
#customer-order-form .customer-store-availability.is-open {
    border-color: #b8dfc3;
    border-left-color: #16B84E;
    background: #f0faf2;
    color: #145b2d;
}
#customer-order-form .customer-store-availability.is-closed {
    border-left-color: #858e88;
}
#customer-order-form #submitCustOrderBtn:disabled {
    background: #d8ded9 !important;
    color: #4d5851 !important;
    cursor: not-allowed;
    opacity: 1;
}
@media (max-width: 420px) {
    #customer-order-form .customer-store-availability { font-size: 13px; }
}
/* =======================================================
   IDENTIDAD DE MARCA
   ======================================================= */

#main-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0 4px;
}

#main-logo {
    display: block;
    width: 100%;
    max-width: 290px;
    height: auto;
}

@media (max-width: 640px) {
    #main-header {
        padding-top: 6px;
    }

    #main-logo {
        max-width: 230px;
    }
}
