/* Reset and Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --primary-color: #990047;
    --primary-dark: #770035;
    --secondary-color: #D4AF37;
    --accent-color: #CD853F;
    --text-dark: #2C1810;
    --text-light: #6B4423;
    --bg-light: #FAF5F0;
    --bg-white: #FFFFFF;
    --border-color: #E8DCC6;
    --success-color: #28A745;
    --error-color: #DC3545;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #FAF5F0 0%, #F5E6D3 100%);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--primary-color);
    padding: 2rem 1.25rem 1.75rem;
    box-shadow: 0 4px 12px rgba(153, 0, 71, 0.25);
    text-align: center;
    border-radius: 0 0 18px 18px;
}

.logo-image {
    max-width: 140px;
    height: auto;
    margin-bottom: 0.75rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: brightness(0) invert(1);
}

.tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2.5rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}

.hero-section {
    text-align: left;
    margin-bottom: 2.25rem;
}

.welcome-text {
    font-size: clamp(1.5rem, 5vw, 1.85rem);
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Action Buttons */
.action-buttons {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: auto;
}

.btn {
    width: 100%;
    padding: 1.05rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 56px;
    box-shadow: 0 4px 12px var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #B8941F 100%);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #B8941F 0%, var(--secondary-color) 100%);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-size: 0.98rem;
}

.store-status {
    font-size: 0.75rem;
    display: block;
    margin-top: 0.25rem;
    opacity: 0.9;
    font-weight: 500;
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    margin-top: 1rem;
}

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

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--bg-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-submit.loading .btn-text {
    opacity: 0;
}

.btn-submit.loading .btn-loader {
    display: block;
    position: absolute;
}

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

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 1.75rem 1.5rem 1.5rem;
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-title {
    font-size: 1.35rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Form Styles */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: var(--error-color);
}

.mobile-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.mobile-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.country-code-select {
    padding: 0.875rem 0.5rem;
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    border-right: 2px solid var(--border-color);
    cursor: pointer;
    outline: none;
}

.mobile-input-wrapper input {
    border: none;
    flex: 1;
    padding: 0.875rem 1rem;
}

.mobile-input-wrapper input:focus {
    box-shadow: none;
}

.error-message {
    font-size: 0.75rem;
    color: var(--error-color);
    min-height: 1rem;
    display: block;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.form-message.error {
    display: block;
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Store List Styles - Compact Version */
.modal-content-wide {
    max-width: 600px;
}

.store-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.store-card {
    background: var(--bg-white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.store-card:hover {
    box-shadow: 0 6px 16px rgba(153, 0, 71, 0.12);
}

/* Compact Image with Overlays */
.store-card-image {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.store-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Pills on Image */
.image-overlay-top {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}

.pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.8rem;
    font-weight: 600;
}

.weather-pill {
    color: var(--primary-dark);
}

.distance-pill {
    color: var(--text-dark);
    margin-left: auto;
}

.pill-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.pill-icon-svg {
    width: 14px;
    height: 14px;
    color: var(--primary-color);
}

.pill-text {
    line-height: 1;
    white-space: nowrap;
}

/* Amenities at Bottom of Image */
.image-overlay-bottom {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    z-index: 2;
}

.amenities-row {
    display: flex;
    gap: 0.5rem;
}

.amenity-badge {
    padding: 0.35rem 0.65rem;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Compact Content Section */
.store-card-content-compact {
    padding: 0.875rem 1rem;
}

.store-title-compact {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0 0 0.5rem;
}

/* Compact Landmarks */
.landmarks-compact {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
}

.landmarks-label {
    color: var(--text-dark);
    font-weight: 600;
    white-space: nowrap;
}

.landmarks-text {
    color: var(--text-light);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Products List (Always Visible) */
.products-list {
    margin-bottom: 0.75rem;
}

.products-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.products-items {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.8;
}

.products-items span {
    display: inline;
}

/* Get Directions Button */
.btn-get-directions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(153, 0, 71, 0.2);
}

.btn-get-directions:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 0 5px 14px rgba(153, 0, 71, 0.3);
    transform: translateY(-1px);
}

.btn-get-directions:active {
    transform: translateY(0);
}

.btn-icon-svg {
    width: 18px;
    height: 18px;
}

/* Loading State */
.store-item.loading {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .header {
        padding: 1.75rem 1rem 1.5rem;
    }

    .logo h1 {
        font-size: 1.35rem;
    }

    .main-content {
        padding: 2rem 1rem 1.5rem;
    }

    .welcome-text {
        font-size: 1.5rem;
    }

    .modal-content {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .footer {
        padding: 2rem 1.25rem 1.5rem;
    }
}

/* Mobile-first bottom-sheet modals */
@media (max-width: 480px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: 18px 18px 0 0;
    }
}

/* Footer */
.footer {
    background: #8B7355;
    border-top: 1px solid #6B5645;
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 100%;
}

.footer-logo {
    max-width: 100px;
    height: auto;
    margin-bottom: 1rem;
    opacity: 1;
    filter: brightness(0) invert(1);
}

.footer-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.footer-address {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-contact {
    margin: 1rem 0;
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.footer-link:hover {
    opacity: 0.7;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.social-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-link:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin: 1.25rem 0 1rem;
    flex-wrap: wrap;
}

.footer-copyright {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1.25rem;
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

