/* public/css/style.css */

/* --- General Body/HTML Styles --- */
body {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 0;
    background-color: #f7f9fc;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Global Header Styles (for non-POS pages) --- */
header {
    background-color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
    margin-right: 10px;
}

.logo h1 {
    margin: 0;
    color: #007bff;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #007bff;
}

/* --- Hero Section Styles --- */
.hero {
    padding: 60px 0;
    background-image: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-text {
    flex: 1;
    padding-right: 40px;
}

.hero-text h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
}

.hero-text .subheadline {
    font-size: 1.2em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

.cta-buttons a {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.primary-cta {
    background-color: #007bff;
    color: #fff;
    margin-right: 15px;
}

.primary-cta:hover {
    background-color: #0056b3;
}

.secondary-cta {
    background-color: #fff;
    color: #007bff;
    border: 2px solid #007bff;
}

.secondary-cta:hover {
    background-color: #e0f7fa;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 80%;
    height: auto;
    border-radius: 8px;
}

/* --- Benefits Section Styles --- */
.benefits {
    padding: 60px 0;
    background-color: #fff;
}

.benefits h2 {
    font-size: 2em;
    color: #333;
    text-align: center;
    margin-bottom: 40px;
}

.benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.benefit-card {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.benefit-card img {
    height: 60px;
    margin-bottom: 15px;
    color: #007bff;
}

.benefit-card h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

.benefit-card p {
    color: #666;
    line-height: 1.6;
}

/* --- Why Nubiko Section Styles --- */
.why-nubiko {
    padding: 80px 0;
    background-color: #f0f8ff;
}

.why-nubiko .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.why-nubiko-text {
    flex: 1;
    padding-right: 40px;
}

.why-nubiko-text h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 20px;
}

.why-nubiko-text p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}

.why-nubiko-image {
    flex: 1;
    text-align: center;
}

.why-nubiko-image img {
    max-width: 70%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* --- Call to Action Final Section Styles --- */
.cta-final {
    padding: 60px 0;
    background-color: #fff;
    text-align: center;
}

.cta-final h2 {
    font-size: 2.2em;
    color: #333;
    margin-bottom: 15px;
}

.cta-final p {
    color: #555;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* --- Footer Styles --- */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
}

/* --- Login Button in Navigation (for non-POS pages) --- */
nav ul li .login-button {
    background-color: #28a745;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    border: none;
}

nav ul li .login-button:hover {
    background-color: #218838;
}


/* ========================================================= */
/* --- POS Specific Styles (Refined Layout & Scrolling) --- */
/* ========================================================= */

.pos-html-body {
    height: 100vh;
    overflow: hidden;
}
.pos-wrapper {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.pos-layout-flex {
    flex: 1;
    overflow: hidden;
}
.pos-main-full-width {
    padding: 0 !important;
    background-color: #f8f9fa;
}

.pos-internal-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    min-height: 60px;
    box-sizing: border-box;
}
.pos-nav-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.pos-nav-info .biz-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #212529;
}
.pos-nav-info .branch-name {
    font-size: 0.9rem;
    color: #6c757d;
}
.pos-nav-user-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.pos-nav-user-actions .user-text {
    font-size: 0.95rem;
    color: #495057;
}
.pos-nav-user-actions .user-text .highlight {
    font-weight: 600;
    color: #007bff;
}
.pos-nav-user-actions .action-link {
    text-decoration: none;
    color: #007bff;
    font-weight: 500;
    transition: color 0.2s ease;
}
.pos-nav-user-actions .action-link:hover {
    color: #0056b3;
}
.pos-nav-user-actions .logout-link {
    color: #dc3545;
}
.pos-nav-user-actions .logout-link:hover {
    color: #bd2130;
}

.pos-main-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    background-color: #f1f3f5;
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    min-height: 70px;
}

.btn-pos-option-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.8rem;
    min-width: 90px;
    height: 70px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    color: #495057;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.btn-pos-option-top:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.btn-pos-option-top .icon-medium {
    width: 28px;
    height: 28px;
    margin-bottom: 0.3rem;
}

.btn-danger-top {
    background-color: #fce8e9;
    color: #dc3545;
    border-color: #f5c6cb;
}
.btn-danger-top:hover {
    background-color: #f8d7da;
}

.btn-secondary-top {
    background-color: #f0f3f5;
    color: #495057;
    border-color: #d6dbdf;
}
.btn-secondary-top:hover {
    background-color: #e9ecef;
}

.btn-success-top {
    background-color: #e6ffed;
    color: #28a745;
    border-color: #c3e6cb;
}
.btn-success-top:hover {
    background-color: #d4edda;
}

.pos-main-content {
    display: grid;
    grid-template-columns: 65% 35%;
    grid-template-rows: auto 1fr;
    gap: 2rem;
    padding: 2rem;
    box-sizing: border-box;
    max-width: 1400px;
    margin: 0 auto;
    flex-grow: 1;
    height: calc(100vh - 60px - 70px);
    overflow: hidden;
}

.grid-area-search-product {
    grid-column: 1;
    grid-row: 1;
}

.grid-area-customer {
    grid-column: 2;
    grid-row: 1;
}

.grid-area-sale-items {
    grid-column: 1;
    grid-row: 2;
}

.grid-area-sale-summary {
    grid-column: 2;
    grid-row: 2;
}

.card {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table-card {
    padding-bottom: 1.5rem;
    overflow-y: hidden;
}

.summary-card {
    overflow-y: hidden;
}

.table-card .table-container {
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
}

.summary-card .summary-details {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.payment-buttons {
    justify-content: space-between;
    margin-top: auto;
    flex-shrink: 0;
}

h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1.5rem;
}

input[type="text"], input[type="number"] {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #495057;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    border: none;
}
.btn-primary {
    background-color: #007bff;
    color: #fff;
}
.btn-primary:hover {
    background-color: #0056b3;
}
.btn-secondary {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
}
.btn-secondary:hover {
    background-color: #dee2e6;
}
.btn-danger {
    color: #dc3545;
    background: none;
    border: none;
    padding: 0.5rem;
}
.btn-danger:hover {
    color: #bd2130;
    text-decoration: underline;
}
.btn:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
    color: #6c757d;
}

.feedback-message {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: #6c757d;
}
.feedback-message.error { color: #dc3545; }
.feedback-message.success { color: #28a745; }

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.alert-info { background-color: #e0f7fa; border-color: #00bcd4; color: #006064; }
.alert-warning { background-color: #fff3e0; border-color: #ff9800; color: #e65100; }
.alert-error { background-color: #ffebee; border-color: #f44336; color: #c62828; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
thead {
    background-color: #f1f3f5;
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 10;
}
th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
    color: #495057;
}
tbody tr:last-child td {
    border-bottom: none;
}
tbody tr:hover {
    background-color: #f8f9fa;
}
td.text-center { text-align: center; }
td.text-right { text-align: right; }
.quantity-input {
    width: 60px;
    padding: 0.4rem 0.6rem;
    text-align: center;
    border-radius: 0.3rem;
    background-color: #fdfdfe;
}

.card-header-row {
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.customer-info-area {
    text-align: right;
}
.customer-search-row {
    margin-top: 0.5rem;
}

.summary-details {
    gap: 0.5rem;
    font-size: 1.1rem;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 1.1rem;
    color: #495057;
}
.summary-total {
    font-size: 1.8rem;
    font-weight: 700;
    color: #212529;
    border-top: 2px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: none;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 550px;
    transform: translateY(-20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}
.modal-overlay.visible .modal-content {
    transform: translateY(0);
    opacity: 1;
}
.modal-description {
    color: #6c757d;
    margin-bottom: 1.5rem;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
}


/* Utility classes for flex/spacing */
.flex-row { display: flex; align-items: center; gap: 1rem; }
.flex-col { display: flex; flex-direction: column; gap: 1rem; }
.mb-large { margin-bottom: 2rem; }
.mt-auto { margin-top: auto; }
.text-muted { color: #6c757d; font-size: 0.9rem; }
.font-semibold { font-weight: 600; }
.text-red { color: #dc3545; }
.text-teal { color: #20c997; }
.hidden { display: none !important; }

/* ========================================================= */
/* --- ESTILOS ADICIONALES PARA DEVOLUCIONES Y OTROS MÓDULOS --- */
/* ========================================================= */

.content-card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.input-form {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #495057;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-form:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-group .btn {
    border-radius: 0;
    border-right-width: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    border-right-width: 1px;
}

/* Estado activo para el grupo de botones y métodos de reembolso */
.btn-group .btn.active, .refund-method-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* ==================================== */
/* --- Responsive Adjustments --- */
/* ==================================== */
@media (max-width: 1024px) {
    .pos-main-content {
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .pos-internal-top-nav {
        padding: 0.8rem 1.5rem;
    }
    .card {
        padding: 2rem;
    }
    h3 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    .pos-main-options {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    .btn-pos-option-top {
        min-width: 80px;
        height: 65px;
        font-size: 0.75rem;
    }
    .btn-pos-option-top .icon-medium {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 768px) {
    .pos-internal-top-nav {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        min-height: auto;
    }
    .pos-nav-user-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
        margin-top: 0.5rem;
    }
    .pos-nav-info {
        flex-direction: column;
        text-align: center;
        gap: 0.2rem;
    }

    .pos-main-options {
        padding: 0.5rem;
        gap: 0.4rem;
        justify-content: center;
        min-height: auto;
    }
    .btn-pos-option-top {
        min-width: 70px;
        height: 60px;
        font-size: 0.7rem;
        padding: 0.5rem 0.6rem;
    }
    .btn-pos-option-top .icon-medium {
        width: 22px;
        height: 22px;
    }

    .pos-main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr 1fr;
        padding: 1rem;
        height: auto;
        max-height: none;
        overflow-y: visible;
    }

    .grid-area-search-product { grid-column: 1; grid-row: 1; }
    .grid-area-customer { grid-column: 1; grid-row: 2; }
    .grid-area-sale-items { grid-column: 1; grid-row: 3; }
    .grid-area-sale-summary { grid-column: 1; grid-row: 4; }

    .card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .table-container {
        overflow-x: auto;
    }
    table {
        display: block;
        white-space: nowrap;
    }
    thead, tbody tr {
        display: table-row;
    }
    th, td {
        min-width: 80px;
        white-space: normal;
    }
    .quantity-input {
        width: 45px;
    }

    .flex-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .flex-row button, .flex-row input {
        width: 100%;
    }
    .payment-buttons {
        flex-direction: row;
        gap: 1rem;
    }
    .payment-buttons .btn {
        width: 48%;
    }
    .payment-buttons .btn-primary {
        width: 48%;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1rem;
    }
    h3 {
        font-size: 1.2rem;
    }
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    .summary-item, .summary-total {
        font-size: 1rem;
    }
    .summary-total {
        font-size: 1.5rem;
    }
    .payment-buttons {
        flex-direction: column;
    }
    .payment-buttons .btn, .payment-buttons .btn-primary {
        width: 100%;
    }
    .btn-pos-option-top {
        min-width: 60px;
        height: 55px;
        font-size: 0.65rem;
        padding: 0.4rem 0.5rem;
    }
    .btn-pos-option-top .icon-medium {
        width: 20px;
        height: 20px;
    }
}

.inventory-table thead {
    background-color: #f1f3f5;
    position: sticky;
    top: 0;
    z-index: 10;
}
.inventory-table th, .inventory-table td {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
}
.inventory-table td.text-center { text-align: center; }
.inventory-table td.text-right { text-align: right; }

.modal-content[style="max-width: 700px;"] {
    max-width: 700px;
}

.feedback-message.info {
    color: #007bff;
}