/**
 * Kite Listino Online - Frontend Styles
 *
 * @package Kite_Listino
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --ko-primary: #2dc0cc;
    --ko-primary-dark: #04A6BC;
    --ko-secondary: #64748b;
    --ko-success: #10b981;
    --ko-warning: #f59e0b;
    --ko-error: #ef4444;
    --ko-border: #e2e8f0;
    --ko-bg: #f8fafc;
    --ko-text: #1e293b;
    --ko-text-light: #64748b;
    --ko-radius: 8px;
    --ko-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --ko-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Base Wrapper
   ========================================================================== */
.ko-order-form-wrapper,
.ko-orders-history-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ko-text);
    line-height: 1.5;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   Notices
   ========================================================================== */
.ko-notice {
    padding: 15px 20px;
    border-radius: var(--ko-radius);
    margin-bottom: 20px;
}

.ko-notice-info {
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.ko-notice-warning {
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.ko-notice-error {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.ko-notice a {
    color: inherit;
    font-weight: 600;
}

/* ==========================================================================
   Discount Info
   ========================================================================== */
.ko-discount-info {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border: 1px solid #93c5fd;
    border-radius: var(--ko-radius);
    padding: 15px 20px;
    margin-bottom: 25px;
}

.ko-discount-info h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--ko-text);
}

.ko-discount-thresholds {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ko-discount-thresholds > span:first-child {
    color: var(--ko-text-light);
    font-size: 14px;
}

.ko-threshold-badge {
    background: white;
    border: 1px solid var(--ko-border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
}

/* ==========================================================================
   Categories Accordion
   ========================================================================== */
.ko-categories-accordion {
    border: 1px solid var(--ko-border);
    border-radius: var(--ko-radius);
    overflow: hidden;
    margin-bottom: 25px;
}

.ko-category-section {
    border-bottom: 1px solid var(--ko-border);
}

.ko-category-section:last-child {
    border-bottom: none;
}

.ko-category-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--ko-bg);
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.ko-category-header:hover {
    background: #f1f5f9;
}

.ko-category-header[aria-expanded="true"] {
    background: #f1f5f9;
}

.ko-category-toggle {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    color: var(--ko-text-light);
    transition: transform 0.2s;
}

.ko-category-header[aria-expanded="true"] .ko-category-toggle {
    transform: rotate(180deg);
}

.ko-toggle-icon {
    width: 100%;
    height: 100%;
}

.ko-category-name {
    font-weight: 600;
    font-size: 16px;
    flex-grow: 1;
}

.ko-category-count {
    color: var(--ko-text-light);
    font-size: 14px;
    margin-right: 20px;
}

.ko-category-qty {
    font-size: 14px;
    color: var(--ko-text-light);
    margin-right: 20px;
}

.ko-category-qty strong {
    color: var(--ko-text);
}

.ko-category-subtotal {
    font-size: 14px;
    color: var(--ko-text-light);
}

.ko-category-subtotal strong {
    color: var(--ko-primary);
}

.ko-category-content {
    padding: 0;
    background: white;
}

/* ==========================================================================
   Products Table
   ========================================================================== */
.ko-products-table {
    width: 100%;
    border-collapse: collapse;
}

.ko-products-table thead th {
    background: #f1f5f9;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ko-text-light);
    border-bottom: 1px solid var(--ko-border);
}

.ko-products-table tbody tr {
    border-bottom: 1px solid var(--ko-border);
    transition: background-color 0.2s;
}

.ko-products-table tbody tr:last-child {
    border-bottom: none;
}

.ko-products-table tbody tr:hover {
    background-color: #f8fafc;
}

.ko-products-table tbody tr.ko-has-quantity {
    background-color: #f0fdf4;
}

.ko-products-table td {
    padding: 12px 15px;
    vertical-align: middle;
      white-space: nowrap;
}

.ko-col-thumb {
    width: 70px;
}

.ko-col-thumb img {
    width: 50px;
    height: auto;
    max-height: 75px;
    object-fit: contain;
    border-radius: 4px;
}

.ko-col-sku {
    width: 120px;
    font-size: 13px;
    color: var(--ko-text-light);
    font-family: monospace;
}

.ko-col-name {
    min-width: 200px;
}

.ko-col-name a {
    color: var(--ko-text);
    text-decoration: none;
}

.ko-col-name a:hover {
    color: var(--ko-primary);
}

.ko-col-price {
    width: 100px;
    text-align: right;
}

.ko-col-qty {
    width: 100px;
    text-align: center;
}

.ko-col-subtotal {
    width: 120px;
    text-align: right;
    font-weight: 600;
}

.ko-badge-featured {
    display: inline-block;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

.ko-qty-input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid var(--ko-border);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ko-qty-input:focus {
    outline: none;
    border-color: var(--ko-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ko-qty-input::-webkit-inner-spin-button,
.ko-qty-input::-webkit-outer-spin-button {
    opacity: 1;
}

/* ==========================================================================
   Order Summary
   ========================================================================== */
.ko-order-summary {
    background: var(--ko-bg);
    border: 1px solid var(--ko-border);
    border-radius: var(--ko-radius);
    padding: 20px;
    margin-bottom: 25px;
}

.ko-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.ko-summary-row:not(:last-child) {
    border-bottom: 1px solid var(--ko-border);
}

.ko-summary-discount {
    color: var(--ko-success);
}

.ko-summary-total {
    font-size: 18px;
    padding-top: 15px;
}

/* ==========================================================================
   Customer Note
   ========================================================================== */
.ko-customer-note {
    margin-bottom: 25px;
}

.ko-customer-note label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.ko-customer-note textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--ko-border);
    border-radius: var(--ko-radius);
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ko-customer-note textarea:focus {
    outline: none;
    border-color: var(--ko-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.ko-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--ko-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ko-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ko-btn-primary {
    background: linear-gradient(135deg, var(--ko-primary) 0%, var(--ko-primary-dark) 100%);
    color: white;
}

.ko-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--ko-shadow-lg);
}

.ko-btn-secondary {
    background: white;
    color: var(--ko-text);
    border: 1px solid var(--ko-border);
}

.ko-btn-secondary:hover:not(:disabled) {
    background: var(--ko-bg);
    border-color: #cbd5e1;
}

.ko-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.ko-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.ko-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ko-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.ko-modal-content {
    position: relative;
    background: white;
    border-radius: var(--ko-radius);
    box-shadow: var(--ko-shadow-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: ko-modal-in 0.2s ease-out;
}

@keyframes ko-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.ko-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.ko-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--ko-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.ko-modal-close:hover {
    background: var(--ko-bg);
}

.ko-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.ko-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--ko-border);
}

/* ==========================================================================
   Preview
   ========================================================================== */
.ko-preview-section {
    margin-bottom: 20px;
}

.ko-preview-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.ko-preview-table {
    width: 100%;
    border-collapse: collapse;
}

.ko-preview-table th,
.ko-preview-table td {
    padding: 10px;
    border-bottom: 1px solid var(--ko-border);
    text-align: left;
}

.ko-preview-table th {
    font-weight: 600;
    font-size: 13px;
    color: var(--ko-text-light);
    text-transform: uppercase;
}

.ko-text-center {
    text-align: center !important;
}

.ko-text-right {
    text-align: right !important;
}

.ko-preview-totals {
    background: var(--ko-bg);
    border-radius: var(--ko-radius);
    padding: 15px;
}

.ko-totals-table {
    width: 100%;
}

.ko-totals-table td {
    padding: 8px;
}

.ko-discount-row {
    color: var(--ko-success);
}

.ko-discount-value {
    color: var(--ko-success);
}

.ko-total-row {
    font-size: 18px;
    border-top: 2px solid var(--ko-border);
}

.ko-preview-notice {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--ko-radius);
    padding: 15px;
    font-size: 14px;
}

.ko-preview-notice p {
    margin: 0;
}

.ko-preview-custom-note {
    /* margin-top: 10px; */
    padding-top: 10px;
    /* border-top: 1px dashed #fcd34d; */
}

.ko-form-custom-note {
    background: #2dc0cc1c;
  border: 1px solid #2dc0cc;
    border-radius: var(--ko-radius);
    padding: 15px;
    margin-bottom: 20px;
}

/* ==========================================================================
   Confirmation
   ========================================================================== */
.ko-confirmation-wrapper {
    text-align: center;
    padding: 20px;
}

.ko-confirmation-icon {
    width: 64px;
    height: 64px;
    background: var(--ko-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.ko-confirmation-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.ko-confirmation-message h2 {
    margin: 0 0 10px 0;
    color: var(--ko-success);
}

.ko-confirmation-message p {
    margin: 0;
    color: var(--ko-text-light);
}

.ko-confirmation-summary {
    background: var(--ko-bg);
    border-radius: var(--ko-radius);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.ko-confirmation-summary table {
    width: 100%;
}

.ko-confirmation-summary td {
    padding: 8px;
}

.ko-confirmation-email {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--ko-text-light);
}

.ko-confirmation-actions {
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   Orders History
   ========================================================================== */
.ko-orders-history-wrapper h2 {
    margin: 0 0 20px 0;
}

.ko-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--ko-border);
    border-radius: var(--ko-radius);
    overflow: hidden;
}

.ko-orders-table th,
.ko-orders-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--ko-border);
}

.ko-orders-table th {
    background: var(--ko-bg);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ko-text-light);
}

.ko-orders-table tbody tr:last-child td {
    border-bottom: none;
}

.ko-orders-table tbody tr:hover {
    background: #f8fafc;
}

.ko-order-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.ko-status-pending {
    background: #e41919;
  color: #fff;
  font-variant: all-small-caps;
}

.ko-status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.ko-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.ko-status-cancelled,
.ko-status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.ko-status-on-hold {
    background: #e0e7ff;
    color: #3730a3;
}

.ko-discount-applied {
    color: var(--ko-success);
    font-weight: 600;
}

.ko-order-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   Loader
   ========================================================================== */
.ko-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ko-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ko-border);
    border-top-color: var(--ko-primary);
    border-radius: 50%;
    animation: ko-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes ko-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .ko-category-header {
        flex-wrap: wrap;
    }

    .ko-category-qty,
    .ko-category-subtotal {
        margin-top: 8px;
        padding-left: 34px;
    }

    .ko-category-qty {
        margin-right: 15px;
    }

    .ko-products-table {
        display: block;
    }

    .ko-products-table thead {
        display: none;
    }

    .ko-products-table tbody,
    .ko-products-table tr,
    .ko-products-table td {
        display: block;
    }

    .ko-products-table tr {
        padding: 15px;
        border-bottom: 1px solid var(--ko-border);
    }

    .ko-products-table td {
        padding: 5px 0;
        border: none;
    }

    .ko-col-thumb {
        float: left;
        margin-right: 15px;
    }

    .ko-col-sku::before {
        content: "ISBN: ";
        color: var(--ko-text-light);
    }

    .ko-col-price::before {
        content: "Prezzo: ";
    }

    .ko-col-subtotal::before {
        content: "Subtotale: ";
    }

    .ko-col-qty {
        text-align: left;
    }

    .ko-form-actions {
        flex-direction: column;
    }

    .ko-form-actions .ko-btn {
        width: 100%;
    }

    .ko-orders-table {
        display: block;
    }

    .ko-orders-table thead {
        display: none;
    }

    .ko-orders-table tbody,
    .ko-orders-table tr,
    .ko-orders-table td {
        display: block;
    }

    .ko-orders-table tr {
        padding: 15px;
        border-bottom: 1px solid var(--ko-border);
    }

    .ko-orders-table td {
        padding: 5px 0;
        border: none;
    }

    .ko-order-actions {
        margin-top: 10px;
    }

    .ko-modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .ko-modal {
        padding: 0;
    }
}



/* ==========================================================================
   my account
   ========================================================================== */
 .woocommerce-MyAccount-navigation-link {
  border: 1px solid #fff;  
  background-color: var(--ko-primary);
 a {
  color: #fff;
  font-weight: 500;
  text-transform: uppercase;
}
 }

 .woocommerce-MyAccount-navigation-link.is-active a{
    color: #333;
 }



/* ==========================================================================
   menu
   ========================================================================== */
 .menu-item:hover > .menu-link,
 .menu-item.current-menu-item > .menu-link {
  color: var(--ko-primary-dark)!important;
  text-decoration: underline;
}


button:hover{
    color: var(--ko-primary-dark)!important;
}

a.ko-btn:hover{
background-color: var(--ko-primary-dark)!important;
color: #fff!important;
}