/* Pase Cupón con Código de Barras Rectangular */
.pass.rectangular-layout {
    background: #ffffff;
    color: #1f2937;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 75%;
    box-shadow: 0 4px 10px rgba(0,0,0,.12), 10px 0 15px rgba(0,0,0,.08), -10px 0 15px rgba(0,0,0,.08);
    position: relative;
    border-radius: 8px;
}

/* Bordes dentados removidos - diseño limpio */

/* Header con grid de 3 columnas */
.pass .pass-header {
    padding: 0.5rem 0.7rem 0.9rem;
    height: 3.0rem;
    display: grid;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.3rem 0.3rem 0 0;
    width: 100%;
    box-sizing: border-box;
}

/* Header con logo: Logo | Empresa | Header Fields */
.pass .pass-header.has-logo {
    grid-template-columns: 2rem 1fr auto;
}

/* Header sin logo: Empresa | Header Fields */
.pass .pass-header.no-logo {
    grid-template-columns: 1fr auto;
}

/* Sin logo, ocultar la sección del logo */
.pass .pass-header.no-logo .logo-section {
    display: none;
}

/* Sin logo, el nombre de empresa va en la primera columna */
.pass .pass-header.no-logo .logo-text {
    grid-column: 1;
    justify-self: start;
}

/* Header field con solo key (sin value) */
.pass .header-fields .header-key-only {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.pass .header-fields .field-key-centered {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgb(31, 30, 31);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Logo de la empresa */
.pass .logo-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 2rem;
    max-width: 2rem;
    height: 2rem;
    grid-column: 1;
}

.pass .business-logo {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    border-radius: 0.3rem;
    display: none; /* Oculto por defecto */
}

/* Cuando hay logo, se muestra */
.pass .business-logo[src]:not([src=""]) {
    display: block;
}

.pass .logo-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 2rem;
    max-width: 2rem;
    height: 2rem;
    grid-column: 1;
}

.pass .logo {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    border-radius: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pass .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.3rem;
}

.pass .logo-text {
    font-weight: 600;
    font-size: 0.9375rem;
    grid-column: 2;
    margin-left: 10px;
}

.pass .header-fields {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    grid-column: 3;
    gap: 0.5rem;
}

.pass .header-fields .field-key {
    font-size: 8px;
    display: block;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: bold;
}

.pass .header-fields .field-value {
    font-size: 11px;
    font-weight: bold;
    display: block;
    margin-top: 1px;
}

/* Cada campo individual del header */
.pass .header-fields .field {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    min-width: 0;
}

/* Sección de strip (Primary Field) */
.pass .strip-section {
    position: relative;
    min-height: 6rem;
    padding: 1rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(246, 246, 246);
    overflow: hidden;
}

/* Overlay para mejorar legibilidad del texto sobre imagen - solo cuando está activado */
.pass .strip-section.with-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Asegurar que el texto esté por encima del overlay */
.pass .strip-section .field {
    position: relative;
    z-index: 2;
}

/* Primary field en strip - solo valor, sin key */
.pass .strip-section .field {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 5px;
}

/* Ocultar el key del primary field */
.pass .strip-section .field-key {
    display: none;
}

.pass .strip-section .field-value {
    font-size: 36px;
    font-weight: bold;
    color: rgb(31, 30, 31);
    line-height: 1.1;
    text-align: left;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Texto blanco cuando hay imagen de fondo con overlay */
.pass .strip-section.with-overlay .field-value {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Estilos para primary field con value y label separados */
.pass .strip-section .primary-field {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-left: 5px;
    text-align: left;
}

.pass .strip-section .primary-value {
    font-size: 28px;
    font-weight: bold;
    color: white !important;
    line-height: 1.1;
    text-align: left;
    margin-bottom: 4px;
}

.pass .strip-section .primary-label {
    font-size: 12px;
    font-weight: normal;
    color: white !important;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Texto blanco cuando hay imagen de fondo con overlay */
.pass .strip-section.with-overlay .primary-value {
    color: white;
}

.pass .strip-section.with-overlay .primary-label {
    color: white;
}

/* Información del pase (2x2 grid) */
.pass .pass-body {
    padding: 0.5rem 0.7rem;
}

.pass .card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.pass .card-row:last-child {
    margin-bottom: 0;
}

.pass .field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pass .field-key {
    font-size: 0.55rem;
    font-weight: 500;
    color: rgb(102, 102, 102);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.1;
    margin-bottom: 0.1rem;
}

.pass .field-value {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(31, 30, 31);
    line-height: 1.2;
}

/* Alinear a la izquierda el segundo campo de cada fila pero posicionado a la derecha (Secondary y Auxiliary Fields) */
.pass .card-row .field:nth-child(2) {
    text-align: left;
    justify-self: end;
}

.pass .card-row .field:nth-child(2) .field-key {
    text-align: left;
}

.pass .card-row .field:nth-child(2) .field-value {
    text-align: left;
}

/* Footer con código de barras */
.pass .pass-footer {
    padding: 0.5rem 0.7rem 1rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: auto;
}

.pass .barcode {
    width: 10rem;
    min-height: 5rem;
    max-height: 5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem 0.8rem 0.2rem;
    box-sizing: border-box;
}

.pass .barcode-container {
    background-color: white;
    border-radius: 4px;
    padding: 4px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 8px;
}

.pass .barcode-container img {
    width: auto;
    max-width: 14rem;
    max-height: 5rem;
    object-fit: contain;
    display: block;
}

/* Códigos rectangulares (PDF417, Code 128) */
.pass .barcode-container img[alt*="PDF417"],
.pass .barcode-container img[alt*="Code 128"] {
    max-width: 10rem;
    max-height: 3rem;
}

/* Códigos cuadrados (QR, Aztec, Data Matrix) */
.pass .barcode-container img[alt*="QR"],
.pass .barcode-container img[alt*="Aztec"],
.pass .barcode-container img[alt*="Data Matrix"] {
    max-width: 6rem;
    max-height: 6rem;
    width: 5rem;
    height: 5rem;
}

.pass .powered-by {
    font-size: 10px;
    color: #6b7280;
    text-align: center;
}

/* Responsive para móviles */
@media (max-width: 420px) {
    .pass .pass-body {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "left right"
            "img img"
            "aux aux";
    }

    .pass .primary-section:first-child { grid-area: left; }
    .pass .primary-section:last-child { grid-area: right; }
    .pass .imagen-centro {
        grid-area: img;
        width: 88px;
        height: 44px;
        margin: 6px auto;
    }
    .pass .auxiliary-section {
        grid-area: aux;
        grid-auto-flow: column;
    }
}
