/* Mobile-First Responsive Design for Zodex */
/* Base styles - Mobile first approach */

/* Touch-friendly button improvements */
.as_btn, 
.btn,
button[type="submit"],
input[type="submit"] {
    min-height: 44px; /* iOS minimum touch target */
    min-width: 44px;
    padding: 12px 20px;
    margin: 8px 4px;
    border-radius: 10px;
    font-size: 16px; /* Prevent zoom on iOS */
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Force consistent CTA styling inside zodiac form on all breakpoints */
.as_sign_form .as_btn {
    /* Remove desktop triangles that distort the shape */
    margin-left: 0 !important;
    width: 100%;
    max-width: 420px;
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
    -webkit-clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
}

.as_sign_form .as_btn:before,
.as_sign_form .as_btn:after {
    display: none !important;
    content: none !important;
    border: 0 !important;
}

/* Touch-friendly form elements */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
    min-height: 48px !important;
    padding: 14px 16px !important;
    font-size: 16px !important; /* Prevent zoom on iOS */
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 100% !important;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Form control override for Bootstrap */
.form-control {
    min-height: 48px !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
}

/* Focus states for accessibility */
input:focus,
textarea:focus,
select:focus,
button:focus,
.as_btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-color: #007bff;
}

/* Mobile navigation improvements */
.as_header_detail {
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    padding: 12px;
    cursor: pointer;
    color: #333;
}

/* Responsive images */
.img-responsive,
.responsive-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Improved spacing for mobile */
.mobile-spacing {
    padding: 16px;
}

.mobile-margin {
    margin: 16px 0;
}

/* Better typography for mobile */
.mobile-text {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.mobile-heading {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 16px;
}

/* Card improvements for mobile */
.as_overview_inner,
.as_customer_box,
.as_product_box {
    padding: 20px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form improvements */
.form-group {
    margin-bottom: 24px !important;
}

.form-label,
label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    color: #ffffff !important;
    line-height: 1.4 !important;
}

.form-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 4px;
}

/* Better form layout on mobile */
@media (max-width: 767px) {
    .form-group {
        margin-bottom: 20px !important;
    }
    
    .form-row {
        display: block !important;
    }
    
    .form-row .form-group {
        width: 100% !important;
        margin-right: 0 !important;
    }
    
    /* Stack form elements vertically */
    .row > [class*="col-"] {
        margin-bottom: 15px;
    }
    
    /* Better submit buttons */
    .btn-primary,
    .btn-submit,
    input[type="submit"] {
        width: 100% !important;
        padding: 16px 20px !important;
        font-size: 18px !important;
        margin-top: 20px !important;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile-specific utilities */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

.text-center-mobile {
    text-align: left;
}

/* Improved mobile breakpoints */
@media (max-width: 767px) {
    /* Show mobile elements */
    .show-mobile {
        display: block !important;
    }
    
    .hide-mobile {
        display: none !important;
    }
    
    .text-center-mobile {
        text-align: center;
    }
    
    /* Mobile navigation */
    .mobile-menu-toggle {
        display: block;
    }
    
    .as_menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 1000;
        border-radius: 0 0 12px 12px;
    }
    
    .as_menu.active {
        display: block;
    }
    
    .as_menu ul {
        flex-direction: column;
        padding: 0;
        margin: 0;
    }
    
    .as_menu ul li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid #eee;
    }
    
    .as_menu ul li a {
        display: block;
        padding: 16px 20px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
    }
    
    .as_menu ul li a:hover {
        background-color: #f8f9fa;
    }
    
    /* Header adjustments */
    .as_header_detail {
        width: 100%;
        padding: 0 16px;
    }
    
    .as_logo {
        padding: 12px 16px;
    }
    
    .as_info_detail {
        display: none; /* Hide info on mobile */
    }
    
    /* Banner improvements */
    .as_banner_wrapper {
        padding: 40px 16px;
        text-align: center;
    }
    
    .as_banner_detail h1 {
        font-size: 28px;
        line-height: 1.2;
        margin-bottom: 16px;
    }
    
    .as_banner_detail h5 {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    /* Form improvements */
    .as_sign_form {
        padding: 20px 16px;
        margin: 20px 0;
    }
    
    .as_sign_form .form-row {
        flex-direction: column;
    }
    
    .as_sign_form .form-group {
        width: 100%;
        margin-bottom: 20px;
    }
    
    /* Cards and content */
    .as_overview_inner {
        text-align: center;
        padding: 24px 16px;
    }
    
    .as_customer_box {
        margin-bottom: 20px;
        padding: 20px 16px;
    }
    
    /* Footer improvements */
    .as_footer_wrapper {
        padding: 40px 16px 20px;
    }
    
    .as_footer_wrapper .row > div {
        margin-bottom: 30px;
    }
    
    /* Zodiac signs grid */
    .as_sign_ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
        padding: 0;
        margin: 20px 0;
    }
    
    .as_sign_ul li {
        transform: none !important;
        margin: 0;
        padding: 16px;
        text-align: center;
        /* keep dark theme tiles */
        background: transparent;
        border-radius: 12px;
        box-shadow: none;
        transition: transform 0.3s ease;
    }
    
    .as_sign_ul li:hover {
        transform: translateY(-4px);
    }
    
    /* Sliders - disable on mobile and show grid */
    .slick-slider {
        display: block !important;
    }
    
    .slick-track {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 16px;
        transform: none !important;
    }
    
    .slick-slide {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .slick-arrow,
    .slick-dots {
        display: none !important;
    }
    
    /* Cart and user actions */
    .as_cart_wrapper {
        margin-left: 8px;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 16px;
        max-width: calc(100% - 32px);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    /* Table improvements */
    .table-responsive {
        border: none;
    }
    
    .table-responsive table {
        font-size: 14px;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 12px 8px;
        white-space: nowrap;
    }
    
    /* Newsletter */
    .as_newsletter_box {
        position: static;
        margin: 20px 0;
        padding: 20px;
        border-radius: 12px;
    }
    
    .as_newsletter_box input {
        margin-bottom: 12px;
    }
    
    .as_newsletter_box .as_btn {
        width: 100%;
        margin: 0;
    }
}

/* Mobile overrides for button shape and zodiac cards */
@media (max-width: 767px) {
    /* Keep the orange button shape consistent on mobile */
    .as_btn {
        /* Hex-like shape without pseudo-elements */
        clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
        -webkit-clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
    }

    /* Disable desktop triangles that break on full-width buttons */
    .as_btn:before,
    .as_btn:after {
        display: none !important;
        content: none !important;
    }

    /* Ensure CTA in the zodiac form fills width nicely */
    .as_sign_form .as_btn {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    /* Fix zodiac tiles background on mobile (remove white boxes) */
    .as_sign_ul li {
        background: transparent !important;
        box-shadow: none !important;
        padding: 10px !important;
        border-radius: 0 !important;
    }

    .as_sign_ul li.as_sign_box {
        background-color: #0e344d !important; /* match theme */
    }

    /* Neutralize hover triangles and side arrows on mobile */
    .as_sign_box:before,
    .as_sign_box:after,
    .as_sign_box .as_sign:before,
    .as_sign_box .as_sign:after {
        display: none !important;
        content: none !important;
        border: 0 !important;
    }

    /* Subtle hover only (or none on touch) */
    .as_sign_box:hover {
        background-color: #0f3a56 !important;
        transform: translateY(-2px);
    }
}

/* On devices that don't support hover, fully disable hover color swap */
@media (hover: none) {
    .as_sign_box:hover {
        background-color: #0e344d !important;
        transform: none !important;
    }
}

/* Footer newsletter alignment and shapes */
.as_newsletter_field {
    align-items: stretch;
}

.as_newsletter_field .form-control {
    height: 60px;
    background-color: var(--dark-color2);
    color: var(--primary-color);
    border: none;
    box-shadow: none;
    padding: 0 200px 0 30px; /* reserve space for button */
    border-radius: 10px;
}

.as_newsletter_field .as_btn {
    height: 44px;
    margin-left: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-68%);
    border-radius: 10px;
}

@media (max-width: 576px) {
    .as_newsletter_field .form-control {
        padding-right: 25px; /* button goes full width below */
        border-radius: 10px;
    }
    .as_newsletter_field .as_btn {
        position: static;
        transform: none;
        margin-top: 10px;
        width: 100%;
        height: 55px;
        border-radius: 10px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .as_banner_detail h1 {
        font-size: 24px;
    }
    
    .as_sign_ul {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .as_sign_ul li {
        padding: 12px;
    }
    
    .as_overview_inner {
        padding: 20px 12px;
    }
    
    .mobile-spacing {
        padding: 12px;
    }
    
    .as_btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Tablet improvements */
@media (min-width: 768px) and (max-width: 1024px) {
    .as_sign_ul {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .as_banner_wrapper {
        padding: 60px 40px;
    }
    
    .as_overview_inner {
        padding: 30px 24px;
    }
    
    /* Show some desktop elements on tablet */
    .as_info_detail {
        display: block;
    }
    
    .as_info_detail ul li {
        padding: 10px;
    }
    
    .as_infobox {
        font-size: 13px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp images on retina displays */
    .as_logo img,
    .as_sign_ul li img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mobile-text {
        color: #e0e0e0;
    }
    
    .as_menu {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .as_menu ul li a {
        color: #e0e0e0;
    }
    
    .as_menu ul li a:hover {
        background-color: #3d3d3d;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .as_header_wrapper,
    .as_footer_wrapper,
    .mobile-menu-toggle,
    .as_btn,
    .slick-arrow,
    .slick-dots {
        display: none !important;
    }
    
    .as_main_wrapper {
        margin: 0;
        padding: 0;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}


/* Enhanced Touch Targets */
.as_btn, button, .btn, a.btn {
    min-height: 48px !important;
    min-width: 48px !important;
    padding: 14px 24px !important;
    margin: 8px 4px !important;
}

/* Better spacing for clickable elements */
.as_menu ul li a {
    min-height: 48px !important;
    padding: 16px 20px !important;
    display: flex !important;
    align-items: center !important;
}

/* Card touch targets */
.as_overview_inner, .as_customer_box {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.as_overview_inner:hover, .as_customer_box:hover {
    transform: translateY(-2px);
}
