/**
 * Greeting Cards Page - Mobile Styles
 * App-style design for lovesite.co.il
 */

@media (max-width: 768px) {
    /* ========================================
       Page Body - Mobile
       ======================================== */
    body.greeting-cards-page-body {
        background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 50%, #e1bee7 100%) !important;
        overflow-x: hidden !important;
        min-height: 100vh !important;
    }

    /* Accessibility widget */
    .a11y-widget-panel {
        z-index: 9999 !important;
        position: fixed !important;
    }

    /* ========================================
       MOBILE RESTRUCTURE SUPPORT
       ======================================== */
    body.mobile-restructured > *:not(.greeting-cards-wrapper):not(.mobile-header):not(.mobile-bottom-nav):not(.a11y-widget-panel):not(.a11y-toggle-btn):not(.auth-overlay):not(.pull-to-refresh):not(script):not(style):not(link) {
        display: none !important;
    }

    body.mobile-restructured > .user-top-bar,
    body.mobile-restructured > .site-footer,
    body.mobile-restructured > footer,
    body.mobile-restructured > div:not(.greeting-cards-wrapper):not(.a11y-widget-panel):not(.auth-overlay):not(.pull-to-refresh) {
        display: none !important;
    }

    body.mobile-restructured > .greeting-cards-wrapper {
        display: block !important;
    }

    /* ========================================
       Wrapper - Mobile
       ======================================== */
    .greeting-cards-wrapper {
        display: block !important;
        padding: 70px 0 90px !important;
        min-height: 100vh !important;
        width: 100% !important;
        background: transparent !important;
    }

    .container {
        padding: 0 12px !important;
        max-width: 100% !important;
    }

    /* ========================================
       Page Header - Mobile
       ======================================== */
    .page-header {
        border-radius: 16px !important;
        padding: 24px 16px !important;
        margin-bottom: 20px !important;
    }

    .page-header h1 {
        font-size: 1.5rem !important;
        margin-bottom: 8px !important;
    }

    .page-header p {
        font-size: 0.95rem !important;
    }

    /* ========================================
       Categories - Mobile
       ======================================== */
    .categories {
        padding: 12px !important;
        border-radius: 12px !important;
        margin-bottom: 20px !important;
        gap: 8px !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .category-btn {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        border-radius: 20px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .category-btn .count {
        font-size: 0.75rem !important;
        padding: 2px 6px !important;
    }

    /* ========================================
       Cards Grid - Mobile
       ======================================== */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        margin-bottom: 25px !important;
    }

    .card-item {
        border-radius: 12px !important;
    }

    .card-item:hover {
        transform: none !important;
    }

    .card-item:active {
        transform: scale(0.98) !important;
    }

    .card-image {
        aspect-ratio: 1/1 !important;
    }

    .card-info {
        padding: 10px 12px !important;
    }

    .card-title {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }

    .card-category {
        font-size: 0.75rem !important;
    }

    /* ========================================
       Card Creator Section - Mobile
       ======================================== */
    .card-creator {
        padding: 16px !important;
        border-radius: 16px !important;
        margin-bottom: 25px !important;
    }

    .card-creator h2 {
        font-size: 1.2rem !important;
        margin-bottom: 16px !important;
    }

    .creator-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .preview-area {
        min-height: 200px !important;
        border-radius: 12px !important;
    }

    .form-group label {
        font-size: 0.9rem !important;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
    }

    .form-group textarea {
        min-height: 100px !important;
    }

    /* ========================================
       Messages Grid - Mobile
       ======================================== */
    .messages-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .message-item {
        padding: 12px 14px !important;
        border-radius: 10px !important;
        font-size: 0.9rem !important;
    }

    /* ========================================
       Songs Grid - Mobile
       ======================================== */
    .songs-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    .song-item {
        padding: 8px !important;
        border-radius: 8px !important;
        font-size: 0.75rem !important;
    }

    /* ========================================
       Buttons - Mobile
       ======================================== */
    .btn-primary,
    .btn-secondary,
    .create-btn,
    .share-btn {
        padding: 14px 20px !important;
        font-size: 0.95rem !important;
        border-radius: 12px !important;
        width: 100% !important;
    }

    /* ========================================
       Modal - Mobile
       ======================================== */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh !important;
        border-radius: 16px !important;
        padding: 20px 16px !important;
    }

    .modal-content h2 {
        font-size: 1.2rem !important;
    }

    /* ========================================
       Touch Feedback
       ======================================== */
    .card-item,
    .category-btn,
    .message-item,
    .song-item,
    .btn-primary,
    .btn-secondary {
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }

    /* ========================================
       Safe Area Support
       ======================================== */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .greeting-cards-wrapper {
            padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
        }
    }
}

/* Small phones */
@media (max-width: 375px) {
    .greeting-cards-wrapper {
        padding: 65px 0 85px !important;
    }

    .container {
        padding: 0 10px !important;
    }

    .page-header {
        padding: 20px 14px !important;
    }

    .page-header h1 {
        font-size: 1.3rem !important;
    }

    .cards-grid {
        gap: 10px !important;
    }

    .card-info {
        padding: 8px 10px !important;
    }

    .card-title {
        font-size: 0.8rem !important;
    }
}
