/**
 * PuntoPost Checkout Styles
 */

/* Modal Styles */
.puntopost-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.puntopost-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.puntopost-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    margin: 2% auto;
    background: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1000000;
}

.puntopost-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
}

.puntopost-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.puntopost-modal-close {
    border: none;
    font-size: 28px !important;
    line-height: 1;
    color: #333 !important;
    background-color: #f8f8f8 !important;
    cursor: pointer;
    padding: 0;
    width: 30px !important;
    height: 30px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.puntopost-modal-close:hover {
    color: #555 !important;
}

.puntopost-modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px 25px;
    border-radius: 0 0 8px 8px;
}

body.puntopost-modal-open {
    overflow: hidden;
}

#puntopost-postal-code {
    color: #333 !important;
    background-color: #f8f8f8 !important;
}

/* Search Container */
.puntopost-search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 6px;
}

.puntopost-search-container label {
    color: #333;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.puntopost-search-container input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.puntopost-search-container button {
    padding: 8px 20px;
    white-space: nowrap;
}

.puntopost-mobile-tabs {
    display: none;
}

/* Map Wrapper */
.puntopost-picker-layout {
    display: block;
}

.puntopost-map-wrapper {
    position: relative;
    width: 100%;
}

.puntopost-picker-layout.list-visible {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.puntopost-picker-layout.list-visible .puntopost-map-wrapper {
    flex: 1 1 auto;
    min-width: 0;
}

/* Map Container */
.puntopost-map-container {
    position: relative;
    width: 100%;
    height: 450px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

#puntopost-show-list-btn {
    display: block;
}

.puntopost-map-corner-button {
    position: absolute !important;
    top: 14px;
    right: 14px;
    z-index: 1000;
    padding: 10px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.puntopost-map-corner-button:hover {
    background: #005177;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.puntopost-map-location-button {
    position: absolute !important;
    top: 14px;
    left: 14px;
    z-index: 1000;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 19px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.puntopost-map-location-button:hover {
    background: #005177;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.puntopost-map-location-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
}

/* Pickup List Panel */
.puntopost-pickup-list-panel {
    width: 320px;
    max-width: 35%;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    height: 450px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.puntopost-pickup-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.puntopost-pickup-list-title {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.puntopost-list-header-button {
    padding: 8px 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.puntopost-list-header-button:hover {
    background: #005177;
}

.puntopost-pickup-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.puntopost-pickup-list-empty,
.puntopost-pickup-list-status {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.puntopost-pickup-list-item {
    width: 100%;
    text-align: left;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    padding: 10px;
    cursor: pointer;
    display: block;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.puntopost-pickup-list-item:hover {
    border-color: #0073aa;
}

.puntopost-pickup-list-item.is-selected {
    border-color: #0073aa;
    background: #eef7fd;
    box-shadow: inset 0 0 0 1px #0073aa;
}

.puntopost-pickup-list-item-name {
    display: block;
    color: #222;
    font-weight: 600;
    margin-bottom: 4px;
}

.puntopost-pickup-list-item-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.puntopost-pickup-list-item-distance {
    color: #333;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.puntopost-pickup-list-item-address {
    display: block;
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

.puntopost-pickup-list-item-schedule {
    margin: 6px 0 0 0;
    color: #333;
    font-size: 12px;
}

/* Search Area Button */
.puntopost-search-area-button {
    position: absolute !important;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 12px 24px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.puntopost-search-area-button:hover {
    background: #005177;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%) translateY(-2px);
}

.puntopost-search-area-button:active {
    transform: translateX(-50%) translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Popup Styles */
.puntopost-popup {
    min-width: 300px;
    max-width: 400px;
}

.puntopost-popup h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.puntopost-popup p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.puntopost-popup button {
    margin-top: 10px;
    padding: 8px 15px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
/* Button Container */
#puntopost-shipping-button-container {
    margin: 15px 0;
    padding: 15px;
}

/* Pickup Info Display */
.puntopost-pickup-info {
    margin: 15px 0;
}

.puntopost-pickup-info strong {
    margin: 8px 0;
    display: block;
}

.puntopost-pickup-display-info p {
    margin: 0;
    line-height: 1.6;
}

.puntopost-modal-title {
    font-size: 20px;
    margin: 0;
    color: #333;
}

.puntopost-search-label {
    color: #333;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.puntopost-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.puntopost-search-button {
    padding: 8px 20px;
    white-space: nowrap;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .puntopost-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }

    .puntopost-modal-header {
        padding: 15px 15px;
    }

    .puntopost-modal-title {
        font-size: 18px;
    }

    .puntopost-modal-close {
        font-size: 24px !important;
        width: 28px !important;
        height: 28px !important;
    }

    .puntopost-modal-body {
        padding: 15px 15px;
    }

    .puntopost-search-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        padding: 12px;
        margin-bottom: 15px;
    }

    .puntopost-search-label {
        margin-bottom: 0;
        font-size: 14px;
        flex: 0 0 auto;
    }

    .puntopost-search-input {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 12px;
    }

    .puntopost-search-button {
        width: 100%;
        padding: 10px 20px;
    }

    .puntopost-mobile-tabs {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
    }

    .puntopost-mobile-tab {
        flex: 1 1 50%;
        padding: 10px 12px;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        background: #fff;
        color: #333;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .puntopost-mobile-tab.is-active {
        background: #0073aa;
        color: #fff;
        border-color: #0073aa;
    }

    #puntopost-show-list-btn,
    #puntopost-hide-list-btn {
        display: none !important;
    }

    .puntopost-map-container {
        height: 350px;
    }

    .puntopost-picker-layout.list-visible {
        flex-direction: column;
    }

    .puntopost-picker-layout.list-visible .puntopost-map-wrapper {
        display: none;
    }

    .puntopost-pickup-list-panel {
        width: 100%;
        max-width: 100%;
        height: 350px;
    }

    .puntopost-pickup-list {
        max-height: none;
    }

    .puntopost-search-area-button {
        font-size: 14px;
        padding: 10px 20px;
        bottom: 15px;
    }

    .puntopost-map-corner-button {
        top: 10px;
        right: 10px;
        font-size: 13px;
        padding: 9px 12px;
    }

    .puntopost-map-location-button {
        top: 10px;
        left: 10px;
        width: 34px;
        height: 34px;
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .puntopost-modal-content {
        margin: 2% auto;
        height: 95vh;
        max-height: 95vh;
    }

    .puntopost-modal-header {
        padding: 12px 12px;
    }

    .puntopost-modal-title {
        font-size: 16px !important;
    }

    .puntopost-modal-close {
        font-size: 22px !important;
        width: 26px !important;
        height: 26px !important;
    }

    .puntopost-modal-body {
        padding: 8px 8px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .puntopost-search-container {
        padding: 0;
        margin-bottom: 12px;
    }

    .puntopost-search-label {
        font-size: 13px;
    }

    .puntopost-search-input {
        font-size: 16px;
        padding: 10px;
    }

    .puntopost-map-container {
        height: 100%;
        min-height: 0;
    }

    .puntopost-picker-layout {
        flex: 1 1 auto;
        min-height: 0;
    }

    .puntopost-map-wrapper {
        height: 100%;
    }

    .puntopost-pickup-list-panel {
        padding: 10px;
        height: 100%;
        min-height: 0;
    }

    .puntopost-pickup-list {
        max-height: none;
    }

    .puntopost-search-area-button {
        font-size: 13px;
        padding: 10px 18px;
        bottom: 12px;
    }

    .puntopost-map-corner-button {
        top: 8px;
        right: 8px;
        font-size: 12px;
        padding: 8px 10px;
    }

    .puntopost-map-location-button {
        top: 8px;
        left: 8px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .puntopost-popup {
        min-width: 280px;
        max-width: 320px;
    }

    .puntopost-popup h4 {
        font-size: 15px;
    }

    .puntopost-popup p {
        font-size: 13px;
    }

    .puntopost-popup button {
        font-size: 13px;
        padding: 8px 15px;
    }
}

/* Loading State */
.puntopost-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    color: #333;
    font-weight: 500;
}

.puntopost-loading::after {
    content: "...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Error State */
.puntopost-error {
    padding: 15px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    color: #c62828;
    margin: 15px 0;
}

/* Success State */
.puntopost-success {
    padding: 15px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    color: #2e7d32;
    margin: 15px 0;
}
