﻿* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
}

button, a, .nav-link, .hamburger {
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3) !important;
    touch-action: manipulation !important;
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
    }
}

@media (max-width: 768px) {
    .header {
        height: var(--header-height);
        padding: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    }

    .navbar {
        height: var(--header-height);
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0;
        height: 100%;
    }

    .nav-logo h2 {
        font-size: 1.2rem;
    }

    .nav-logo i {
        font-size: 1rem;
    }

    .nav-logo .logo-icon {
        width: 32px;
        height: 32px;
    }

    .nav-actions {
        display: flex;
        gap: 8px;
        align-items: center;
        margin-right: 0;
        position: relative;
    }

    .cart-btn {
        width: 44px;
        height: 44px;
        padding: 0;
        font-size: 1.1rem;
        flex-shrink: 0;
        position: relative;
        overflow: visible;
        transform: none !important;
        animation: none !important;
        transition: none !important;
        will-change: auto;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .cart-btn:hover {
        transform: none !important;
        animation: none !important;
    }

    .cart-btn:active {
        transform: none !important;
        animation: none !important;
    }

    .cart-btn .iconify,
    .cart-btn i {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        will-change: auto;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .cart-btn #cart-count {
        position: absolute;
        top: 0;
        right: 0;
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
        transform: translate(25%, -25%) !important;
        animation: none !important;
        transition: none !important;
        will-change: contents;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        -webkit-font-smoothing: antialiased;
    }

    .user-container {
        flex-shrink: 0;
    }

    .user-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

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

    .user-btn span {
        display: none;
    }

    main,
    #page-home,
    #page-products,
    #page-services,
    #page-about,
    #page-contact {
        padding-top: var(--header-height);
    }
}

@media (max-width: 768px) {
    #page-home .hero {
        min-height: 70vh;
        padding: 80px 1rem 40px;
    }

    .hero-badge {
        padding: 8px 16px;
        font-size: 0.75rem;
        margin-bottom: 24px;
    }

    .hero-title {
        font-size: 2rem !important;
        margin-bottom: 20px;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 24px;
        padding: 0 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding: 0 1rem;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 12px;
        margin-top: 32px;
        padding: 0 1rem;
    }

    .stat-card {
        width: 100%;
        padding: 16px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .products-section {
        padding: 40px 1rem;
    }

    .section-header {
        padding: 0 0 24px 0;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        padding: 6px;
        -webkit-overflow-scrolling: touch;
        width: calc(100% - 2rem);
        margin: 0 auto 24px auto;
        justify-content: flex-start;
    }

    .filter-btn {
        white-space: nowrap;
        padding: 8px 18px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
    }

    .product-card {
        margin: 0;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .services-section,
    .features-section {
        padding: 40px 1rem;
    }

    .services-grid,
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card,
    .feature-card {
        padding: 24px;
    }

    .service-icon,
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .service-title,
    .feature-title {
        font-size: 1.1rem;
    }

    .service-description,
    .feature-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .reviews-section {
        padding: 40px 0;
    }

    .reviews-carousel {
        padding: 0 1rem;
    }

    .review-card {
        min-width: 100%;
        padding: 24px;
        margin: 0;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .reviewer-info {
        gap: 12px;
    }

    .reviewer-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .reviewer-name {
        font-size: 1rem;
    }

    .review-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .carousel-dots {
        gap: 6px;
        margin-top: 20px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 768px) {
    .cta-section {
        padding: 40px 1rem;
    }

    .cta-content {
        padding: 32px 24px;
    }

    .cta-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .cta-subtitle {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .cta-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    #shopping-cart {
        width: 100%;
        max-width: 100%;
        right: -100%;
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    #shopping-cart.active {
        right: 0;
    }

    .cart-header {
        padding: 16px;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 100;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .cart-header h2 {
        font-size: 1.2rem;
    }

    .cart-items {
        padding: 0 16px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cart-item {
        padding: 16px;
        gap: 12px;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .cart-item-name {
        font-size: 0.95rem;
    }

    .cart-item-price {
        font-size: 1rem;
    }

    .quantity-controls {
        flex-wrap: nowrap;
    }

    .quantity-controls button {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .quantity-display {
        min-width: 40px;
        font-size: 0.95rem;
    }

    .cart-summary {
        padding: 16px;
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        border-top: 1px solid rgba(102, 126, 234, 0.3);
    }

    .cart-total {
        font-size: 1.3rem;
    }

    .btn-checkout {
        padding: 14px;
        font-size: 1rem;
        width: 100%;
    }

    .cart-empty {
        padding: 40px 20px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .checkout-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .checkout-content {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        max-height: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .checkout-header {
        padding: 16px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .checkout-header h2 {
        font-size: 1.3rem;
    }

    .checkout-body {
        flex-direction: column;
        padding: 0;
        overflow: visible;
        flex: 1;
    }

    .checkout-summary,
    .checkout-form {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        overflow: visible;
    }

    .summary-items {
        max-height: none !important;
        overflow: visible !important;
    }

    .summary-item {
        padding: 12px !important;
    }

    .item-name {
        font-size: 0.9rem !important;
    }

    .item-price {
        font-size: 1rem !important;
    }

    .summary-totals {
        padding: 16px !important;
    }

    .total-amount {
        font-size: 1.8rem !important;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 16px !important; 
    }

    .btn-checkout-pay {
        padding: 16px;
        font-size: 1rem;
        position: sticky;
        bottom: 0;
        margin-top: 20px;
    }

    .discount-code-section {
        margin-top: 16px;
    }

    .discount-input-group {
        flex-direction: column;
        gap: 10px;
    }

    .discount-input-group > div {
        width: 100%;
    }

    #discount-code-input {
        font-size: 16px !important; 
    }

    .discount-input-group button {
        width: 100%;
        padding: 12px;
    }

    .checkout-overlay {
        position: fixed;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 80px 1rem 40px;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-content {
        padding: 40px 1rem;
    }

    .content-section {
        padding: 24px 0;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }

    .content-section h3 {
        font-size: 1.2rem;
    }

    .content-section p,
    .content-section li {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

@media (max-width: 768px) {
    .product-detail-content {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        padding: 0;
        overflow-y: auto;
    }

    .product-detail-header {
        padding: 16px;
    }

    .product-detail-body {
        padding: 20px;
    }

    .product-detail-image {
        height: 200px;
    }

    .product-detail-title {
        font-size: 1.4rem;
    }

    .product-detail-price {
        font-size: 1.6rem;
    }

    .product-detail-actions .btn {
        padding: 14px;
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .auth-container {
        width: 95%;
        padding: 24px 20px;
    }

    .auth-title {
        font-size: 1.6rem;
    }

    .auth-form input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .auth-submit {
        padding: 14px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .profile-container {
        padding: 80px 1rem 40px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .profile-info {
        align-items: center;
    }

    .profile-content {
        padding: 0;
    }

    .orders-grid {
        grid-template-columns: 1fr;
    }

    .order-card {
        padding: 16px;
    }
}

@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    body.modal-open {
        overflow-y: auto !important;
        position: relative !important;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    button,
    .btn,
    a {
        min-height: 44px;
        min-width: 44px;
    }

    body {
        font-size: 16px; 
    }

    input,
    textarea,
    select {
        font-size: 16px !important; 
        padding: 12px;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    .modal,
    .checkout-modal,
    .paypal-modal-custom {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content,
    .checkout-content {
        max-height: none !important;
        overflow: visible !important;
    }

    button:active,
    .btn:active,
    a:active,
    .nav-link:active {
        transform: scale(0.98);
        opacity: 0.8;
    }

    a, button, input, select, textarea {
        touch-action: manipulation;
    }

    html {
        scroll-behavior: smooth;
    }

    button:focus-visible,
    a:focus-visible,
    input:focus-visible {
        outline: 2px solid #667eea;
        outline-offset: 2px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    #page-home .hero {
        min-height: 100vh;
        padding: 80px 1rem 40px;
    }

    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .stat-card {
        width: calc(50% - 6px);
    }
}

@media (max-width: 375px) {
    .hero-title {
        font-size: 1.7rem !important;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 12px 20px;
    }

    .product-card {
        padding: 16px;
    }

    .cart-item-image {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 768px) {

    .hamburger {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-around !important;
        width: 44px !important;
        height: 44px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        padding: 10px !important;
        z-index: 1002 !important;
        position: relative !important;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3) !important;
        touch-action: manipulation !important;
    }

    .hamburger:active {
        transform: scale(0.95);
    }

    .hamburger span {
        width: 24px !important;
        height: 3px !important;
        background: #fff !important;
        border-radius: 3px !important;
        transition: all 0.3s ease !important;
        display: block !important;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .nav-menu {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 0 !important;
        background: #16213e !important;
        flex-direction: column !important;
        padding: 0 !important;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5) !important;
        transition: max-height 0.3s ease, padding 0.3s ease !important;
        overflow: hidden !important;
        z-index: 1001 !important;
        display: flex !important;
    }

    .nav-menu.active {
        max-height: 400px !important;
        padding: 1rem 0 !important;
    }

    .nav-menu li {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
        opacity: 0;
        transform: translateX(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.25s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.3s; }

    .nav-menu .nav-link {
        display: block !important;
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        border-left: 3px solid transparent !important;
        transition: all 0.2s ease !important;
        color: rgba(255, 255, 255, 0.9) !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3) !important;
        touch-action: manipulation !important;
        width: 100% !important;
        text-align: left !important;
    }

    .nav-menu .nav-link:active {
        background: rgba(102, 126, 234, 0.4) !important;
        border-left-color: #667eea !important;
    }

    .nav-menu .nav-link.active {
        background: rgba(102, 126, 234, 0.2) !important;
        border-left-color: #667eea !important;
    }
}

@media (max-width: 768px) {
    #calendar-modal .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        overflow-y: auto;
    }

    .calendar-header {
        padding: 16px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .calendar-header h2 {
        font-size: 1.2rem;
    }

    .calendar-navigation {
        padding: 12px 16px;
        background: rgba(26, 26, 46, 0.5);
    }

    .calendar-navigation button {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        font-size: 1.2rem;
    }

    .current-month {
        font-size: 1rem;
    }

    .calendar-grid {
        padding: 12px;
        gap: 8px;
    }

    .calendar-day {
        aspect-ratio: 1;
        min-height: 50px;
        font-size: 0.9rem;
        border-radius: 12px;
    }

    .calendar-day:not(.disabled):active {
        transform: scale(0.95);
    }

    .time-slots-grid {
        padding: 12px;
        gap: 10px;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .time-slot {
        padding: 14px 10px;
        font-size: 0.95rem;
        min-height: 50px;
        border-radius: 12px;
    }

    .time-slot:not(.booked):active {
        transform: scale(0.95);
    }

    .calendar-footer {
        padding: 16px;
        position: sticky;
        bottom: 0;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        border-top: 1px solid rgba(102, 126, 234, 0.3);
    }

    .calendar-footer .btn {
        padding: 16px;
        font-size: 1rem;
        width: 100%;
    }

    .selected-datetime {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .admin-dashboard {
        padding: 80px 0 20px 0;
    }

    .admin-tabs {
        padding: 12px 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 8px;
        position: sticky;
        top: 60px;
        z-index: 100;
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(10px);
    }

    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.9rem;
        padding: 10px 16px;
        min-height: 44px;
    }

    .admin-section {
        padding: 20px 16px;
    }

    .admin-section h2 {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }

    .orders-table,
    .appointments-table {
        display: none;
    }

    .orders-grid,
    .appointments-grid {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .order-card-mobile,
    .appointment-card-mobile {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
        border: 1px solid rgba(102, 126, 234, 0.2);
        border-radius: 12px;
        padding: 16px;
    }

    .order-card-mobile h4,
    .appointment-card-mobile h4 {
        font-size: 1rem;
        margin-bottom: 12px;
        color: #667eea;
    }

    .info-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .info-row:last-child {
        border-bottom: none;
    }

    .info-label {
        font-weight: 600;
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.85rem;
    }

    .info-value {
        color: #fff;
        font-size: 0.9rem;
    }

    .blocked-slots-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .blocked-slot-card {
        padding: 14px;
    }
}

@media (max-width: 768px) {
    .product-card {
        transition: transform 0.1s ease, box-shadow 0.1s ease;
    }

    .product-card:active {
        transform: scale(0.98);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    }

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

    .add-to-cart-btn {
        position: relative;
        overflow: hidden;
    }

    .add-to-cart-btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.4s, height 0.4s;
    }

    .add-to-cart-btn:active::after {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .skeleton {
        background: linear-gradient(90deg, 
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%
        );
        background-size: 200% 100%;
        animation: skeleton-loading 1.5s ease-in-out infinite;
        border-radius: 8px;
    }

    @keyframes skeleton-loading {
        0% {
            background-position: 200% 0;
        }
        100% {
            background-position: -200% 0;
        }
    }

    .skeleton-card {
        height: 300px;
        margin-bottom: 20px;
    }

    .skeleton-text {
        height: 16px;
        margin-bottom: 10px;
    }

    .skeleton-title {
        height: 24px;
        width: 60%;
        margin-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .ptr-element {
        position: absolute;
        top: -50px;
        left: 0;
        right: 0;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: top 0.3s ease;
    }

    .ptr-element.ptr-refresh {
        top: 0;
    }

    .ptr-spinner {
        width: 30px;
        height: 30px;
        border: 3px solid rgba(102, 126, 234, 0.3);
        border-top-color: #667eea;
        border-radius: 50%;
        animation: ptr-spin 1s linear infinite;
    }

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

@media (max-width: 768px) {
    @supports (padding: max(0px)) {
        body {
            padding-left: max(0px, env(safe-area-inset-left));
            padding-right: max(0px, env(safe-area-inset-right));
        }

        .header {
            padding-left: max(0px, env(safe-area-inset-left));
            padding-right: max(0px, env(safe-area-inset-right));
            padding-top: max(0px, env(safe-area-inset-top));
        }

        .cart-summary,
        .checkout-footer,
        .calendar-footer {
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }
    }
}