/* Lazy A's Hat Co - Main Stylesheet */
/* Instagram-like Mobile-First Design */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
}

.loading-logo {
    width: 80px;
    height: auto;
    margin-bottom: 20px;
    opacity: 0.8;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* App Container */
.app-container {
    min-height: 100vh;
    background-color: #000000;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    background-color: #000000;
    border-bottom: 1px solid #262626;
    z-index: 100;
    padding: env(safe-area-inset-top) 0 0 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    max-width: 100%;
}

.logo-container {
    flex: 1;
    text-align: center;
}

.app-logo {
    height: 32px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    position: absolute;
    right: 16px;
}

.header-btn {
    background: none;
    border: none;
    color: #ffffff;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background-color: #1a1a1a;
}

.header-btn:active {
    background-color: #333333;
}

.icon {
    width: 24px;
    height: 24px;
}

.cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #ff3040;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* Stories/Categories Section */
.stories-section {
    padding: 16px 0;
    border-bottom: 1px solid #262626;
}

.stories-container {
    display: flex;
    gap: 16px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-container::-webkit-scrollbar {
    display: none;
}

.story-item {
    flex-shrink: 0;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.story-item:active {
    transform: scale(0.95);
}

.story-circle {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 2px;
    margin-bottom: 8px;
}

.story-circle.active {
    background: #ffffff;
}

.story-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #000000;
}

.story-label {
    font-size: 12px;
    color: #ffffff;
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    padding-bottom: 80px;
}

/* Product Feed */
.product-feed {
    max-width: 100%;
}

.product-post {
    background-color: #000000;
    border-bottom: 1px solid #262626;
    margin-bottom: 0;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.post-info {
    flex: 1;
}

.post-category {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.post-location {
    font-size: 12px;
    color: #8e8e8e;
}

/* Product Images */
.product-images {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.image-indicators {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.image-nav:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.image-nav.prev {
    left: 12px;
}

.image-nav.next {
    right: 12px;
}

/* Product Actions */
.product-actions {
    padding: 12px 16px;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.action-btn {
    background: none;
    border: none;
    color: #ffffff;
    padding: 8px;
    cursor: pointer;
    transition: color 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    color: #8e8e8e;
}

.action-btn.liked {
    color: #ff3040;
}

/* Product Info */
.product-info {
    margin-bottom: 12px;
}

.product-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: #ffffff;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.product-price .sale-price {
    color: #ff3040;
    margin-right: 8px;
}

.product-price .original-price {
    color: #8e8e8e;
    text-decoration: line-through;
    font-weight: 400;
}

.product-description {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 12px;
}

/* Size Selection */
.size-selection {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.size-label {
    font-size: 14px;
    color: #8e8e8e;
    min-width: 40px;
}

.size-picker-btn {
    background-color: #262626;
    border: 1px solid #404040;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.size-picker-btn:hover {
    background-color: #404040;
}

.add-to-cart-btn {
    background-color: #0095f6;
    border: none;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
}

.add-to-cart-btn:hover {
    background-color: #1877f2;
}

.add-to-cart-btn:disabled {
    background-color: #262626;
    color: #8e8e8e;
    cursor: not-allowed;
}

/* WhatsApp Button */
.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: #25d366;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

.whatsapp-btn:active {
    transform: scale(0.95);
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: #000000;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 80vh;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: #000000;
    border-left: 1px solid #262626;
    z-index: 1500;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #262626;
}

.cart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.cart-close {
    background: none;
    border: none;
    color: #ffffff;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-footer {
    padding: 16px;
    border-top: 1px solid #262626;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

.checkout-btn {
    background-color: #0095f6;
    border: none;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease;
}

.checkout-btn:hover {
    background-color: #1877f2;
}

.checkout-btn:disabled {
    background-color: #262626;
    color: #8e8e8e;
    cursor: not-allowed;
}

/* Size Picker Modal */
.size-picker-modal {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    z-index: 2500;
    transition: bottom 0.3s ease;
}

.size-picker-modal.active {
    bottom: 0;
}

.size-picker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.size-picker-content {
    background-color: #000000;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid #262626;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}

.size-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #262626;
}

.size-picker-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.size-picker-close {
    background: none;
    border: none;
    color: #8e8e8e;
    padding: 4px;
    cursor: pointer;
}

.size-picker-body {
    flex: 1;
    overflow: hidden;
    padding: 20px;
}

.size-picker-wheel {
    height: 200px;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

.size-option {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    font-size: 18px;
    font-weight: 500;
    color: #8e8e8e;
    cursor: pointer;
    scroll-snap-align: center;
    transition: all 0.2s ease;
}

.size-option.selected {
    color: #ffffff;
    font-weight: 600;
    transform: scale(1.1);
}

.size-picker-footer {
    padding: 20px;
    border-top: 1px solid #262626;
}

.size-confirm-btn {
    background-color: #0095f6;
    border: none;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease;
}

.size-confirm-btn:hover {
    background-color: #1877f2;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    pointer-events: none;
}

.toast {
    background-color: #262626;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: toastSlideIn 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    background-color: #00ba7c;
}

.toast.error {
    background-color: #ff3040;
}

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

/* Responsive Design */
@media (min-width: 768px) {
    .app-container {
        max-width: 400px;
        margin: 0 auto;
        border-left: 1px solid #262626;
        border-right: 1px solid #262626;
    }
    
    .cart-sidebar {
        max-width: 400px;
    }
}

@media (min-width: 1024px) {
    .whatsapp-btn {
        bottom: 30px;
        right: 30px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Touch and Interaction Improvements */
@media (hover: none) and (pointer: coarse) {
    .header-btn:hover,
    .action-btn:hover,
    .size-picker-btn:hover,
    .add-to-cart-btn:hover,
    .checkout-btn:hover,
    .size-confirm-btn:hover {
        background-color: initial;
        color: initial;
    }
}

/* Payment Result Pages */
.payment-result-page {
    min-height: 100vh;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.result-container {
    max-width: 600px;
    width: 100%;
    background-color: #000000;
    border-radius: 12px;
    border: 1px solid #262626;
    overflow: hidden;
}

.result-header {
    text-align: center;
    padding: 24px 24px 0;
    border-bottom: 1px solid #262626;
}

.result-logo {
    height: 40px;
    width: auto;
    opacity: 0.8;
}

.result-content {
    padding: 40px 24px 24px;
    text-align: center;
}

.result-icon {
    margin-bottom: 24px;
}

.result-icon .icon {
    width: 80px;
    height: 80px;
}

.success-icon {
    color: #00ba7c;
}

.error-icon {
    color: #ff3040;
}

.warning-icon {
    color: #ff9500;
}

.result-content h1 {
    color: #ffffff;
    font-size: 28px;
    margin-bottom: 16px;
    font-weight: 600;
}

.result-message {
    color: #8e8e8e;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 32px;
}

.order-details,
.error-details {
    background-color: #262626;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 32px;
    text-align: left;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: #8e8e8e;
    font-size: 14px;
}

.detail-value {
    color: #ffffff;
    font-weight: 600;
    font-family: monospace;
}

.next-steps,
.troubleshooting {
    text-align: left;
    margin-bottom: 32px;
}

.next-steps h3,
.troubleshooting h3 {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 16px;
}

.next-steps ul,
.troubleshooting ul {
    color: #8e8e8e;
    padding-left: 20px;
}

.next-steps li,
.troubleshooting li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 32px;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 16px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: #0095f6;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1877f2;
}

.btn-secondary {
    background-color: #262626;
    color: #ffffff;
    border: 1px solid #404040;
}

.btn-secondary:hover {
    background-color: #404040;
}

.support-info {
    border-top: 1px solid #262626;
    padding-top: 24px;
    text-align: center;
}

.support-info p {
    color: #8e8e8e;
    margin-bottom: 16px;
}

.contact-options {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #262626;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.contact-btn:hover {
    background-color: #404040;
}

.contact-btn.whatsapp {
    background-color: #25d366;
}

.contact-btn.whatsapp:hover {
    background-color: #128c7e;
}

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

/* Responsive Design for Payment Pages */
@media (max-width: 768px) {
    .payment-result-page {
        padding: 10px;
    }
    
    .result-content {
        padding: 30px 20px 20px;
    }
    
    .result-content h1 {
        font-size: 24px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .contact-options {
        flex-direction: column;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Safe Area Insets for iOS */
@supports (padding: max(0px)) {
    .app-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
    
    .whatsapp-btn {
        bottom: max(20px, env(safe-area-inset-bottom));
        right: max(20px, env(safe-area-inset-right));
    }
}