/* 
 * Apple Education Products and Services Mobile CSS
 * Optimized for mobile devices with screen width up to 896px
 * This file contains mobile-specific styles that override the main CSS
 */

@media screen and (max-width: 896px) {
  /* General Layout Adjustments */
  body {
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
  }

  .content-container {
    padding: 15px 12px;
    margin: 0;
    width: 100%;
  }

  .page-title {
    font-size: 1.8rem;
    padding: 25px 0;
    margin-bottom: 10px;
  }

  /* Apple Authorised Badge */
  .apple-auth-badge-topright {
    position: relative;
    top: 0;
    right: 0;
    text-align: right;
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding-right: 20px;
    box-sizing: border-box;
  }

  .content-container .apple-auth-badge-topright img {
    max-width: 110px;
    height: auto;
  }

  /* Education Market Section */
  .education-market-section {
    padding: 30px 15px;
    margin-bottom: 20px;
  }

  .education-market-content {
    flex-direction: column;
    gap: 20px;
  }

  .education-market-image {
    order: 1;
    flex: 1 1 100%;
  }

  .education-market-text {
    order: 2;
    flex: 1 1 100%;
  }

  .education-market-text h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

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

  /* Software Service Section */
  .software-service-section {
    padding: 30px 15px;
    margin-bottom: 20px;
  }

  .software-service-content {
    flex-direction: column-reverse;
    gap: 20px;
  }

  .software-service-text {
    flex: 1 1 100%;
  }

  .software-service-image {
    flex: 1 1 100%;
  }

  .software-service-text h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  /* Apple Values Section - Enhanced Mobile Layout */
  .apple-values-layout {
    padding: 30px 15px;
  }

  .apple-values-container {
    width: 100%;
    display: block !important;
  }
  
  .apple-values-container.apple-values-layout {
    display: block !important;
  }

  .values-card {
    flex-direction: column;
    padding: 0;
    overflow: visible;
    width: 100%;
    display: block;
    box-sizing: border-box;
    max-width: 100%;
  }

  /* First section - Our Values and Commitments */
  .values-card > .values-section:first-child {
    flex: none;
    width: 100%;
    padding: 25px 20px;
    border-bottom: 1px solid rgba(0, 122, 255, 0.1);
    margin-bottom: 0;
    display: block;
  }

  .values-card > .values-section:first-child::after {
    display: none;
  }

  /* Right content container */
  .values-right-content {
    flex: none;
    width: 100%;
    display: block;
  }

  /* Fix for the three sections in the right content */
  .values-right-content .values-section {
    flex: none;
    width: 100%;
    padding: 25px 20px;
    position: relative;
    border-bottom: 1px solid rgba(0, 122, 255, 0.1);
    display: block;
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }

  .values-right-content .values-section:last-child {
    border-bottom: none;
  }

  /* Remove the pseudo-elements that create dividers */
  .values-right-content .values-section::before {
    display: none;
  }

  /* Section headers */
  .values-section h2 {
    font-size: 1.4rem;
    gap: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
  }

  /* Icon styling */
  .values-section h2 i {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff, #f5f5f7);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05),
                0 0 0 1px rgba(0, 0, 0, 0.02);
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 10px;
  }

  /* Icon colors for different sections */
  .values-card > .values-section:first-child h2 i {
    color: #007aff;
  }

  .values-right-content .values-section:nth-child(1) h2 i {
    color: #34c759;
  }

  .values-right-content .values-section:nth-child(2) h2 i {
    color: #5856d6;
  }
  
  /* Special handling for Our Specialty section with longer text */
  .values-right-content .values-section:nth-child(2) ul li {
    font-size: 0.9rem;
    margin-bottom: 12px;
    padding-right: 5px;
  }

  .values-right-content .values-section:nth-child(3) h2 i {
    color: #ff9500;
  }

  /* List items */
  .values-section ul {
    padding-left: 20px;
    margin-top: 0;
    margin-bottom: 0;
    list-style-type: disc;
    box-sizing: border-box;
    max-width: 100%;
  }

  .values-section ul li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    padding-left: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
    max-width: calc(100% - 25px);
  }
  
  .values-section ul li:last-child {
    margin-bottom: 0;
  }

  /* Contact Us section specific styling */
  .values-right-content .values-section:nth-child(3) p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
  }

  .values-right-content .values-section:nth-child(3) a {
    color: #007aff;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 8px 0;
    position: relative;
  }
  
  .values-right-content .values-section:nth-child(3) a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #007aff, #5ac8fa);
    transform: scaleX(0.3);
    transform-origin: left;
    transition: transform 0.3s ease;
  }
  
  .values-right-content .values-section:nth-child(3) a:active::after {
    transform: scaleX(1);
  }

  /* Service Section */
  .service-section {
    padding: 40px 15px;
  }

  .service-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .service-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .service-card {
    padding: 20px 15px;
    gap: 10px;
  }

  .service-card svg {
    width: 50px;
    height: 50px;
  }

  .service-card span {
    font-size: 0.9rem;
  }

  /* Services Section */
  .services-section {
    padding: 30px 15px;
  }

  .service-item {
    padding: 20px 15px;
  }

  .service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
  }

  .service-text h2 {
    font-size: 1rem;
  }

  /* Experience Section */
  .experience-section {
    padding: 30px 15px;
  }

  .experience-content p {
    font-size: 1rem;
    line-height: 1.6;
  }

  /* MDM Section */
  .mdm-section {
    padding: 30px 15px;
  }

  .mdm-header h2 {
    font-size: 1.5rem;
  }

  .mdm-content > p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .mdm-features {
    padding: 25px 15px;
  }

  .mdm-feature-title h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  .mdm-checkmark {
    font-size: 1rem;
  }

  .mdm-feature-box h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }

  .mdm-feature-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mdm-feature-card {
    padding: 20px 15px;
  }

  .mdm-feature-card h5 {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .mdm-feature-card p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* After Sales Section */
  .after-sales-section {
    padding: 30px 15px;
  }

  .after-sales-header h2 {
    font-size: 1.5rem;
  }

  .after-sales-content p {
    font-size: 1rem;
    line-height: 1.6;
  }

  /* Technical Features Section */
  .tech-features-section {
    padding: 30px 15px;
  }

  .tech-features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .tech-feature-item {
    padding: 20px 15px;
  }

  .tech-feature-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
  }

  .tech-feature-text h3 {
    font-size: 0.9rem;
  }

  /* Maintenance Service & AppleCare Section */
  .maintenance-section {
    padding: 30px 15px;
  }

  .maintenance-header h2 {
    font-size: 1.5rem;
  }

  .maintenance-content p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .applecare-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .applecare-item {
    padding: 25px 15px;
  }

  .applecare-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
  }

  .applecare-item h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  .applecare-item li {
    font-size: 0.95rem;
    margin-bottom: 10px;
    padding-left: 20px;
  }

  .contact-info p {
    font-size: 1rem;
    line-height: 1.6;
  }

  /* K-12 Education Solutions Section */
  .k12-section {
    padding: 30px 15px;
  }

  .k12-header h2 {
    font-size: 1.5rem;
  }

  .k12-cards-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .k12-card {
    padding: 25px 15px;
  }

  .k12-card-badge {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
  }

  .k12-card-badge i {
    font-size: 1.2rem;
  }

  .k12-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  .k12-card p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* Trade-In Section */
  .tradein-section {
    padding: 30px 15px;
  }

  .tradein-hero {
    flex-direction: column;
    margin-bottom: 30px;
    gap: 20px;
  }

  .tradein-hero-content {
    flex: 1 1 100%;
    order: 2;
  }

  .tradein-hero-image {
    flex: 1 1 100%;
    order: 1;
  }

  .tradein-hero-content h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }

  .tradein-hero-content h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }

  .tradein-hero-content p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .tradein-benefits {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
  }

  .benefit-card {
    padding: 25px 15px;
  }

  .benefit-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
  }

  .benefit-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  .benefit-card p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .tradein-pricing {
    margin-bottom: 30px;
  }

  .tradein-pricing h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }

  .table-header {
    padding: 12px 15px;
  }

  .header-left {
    font-size: 1rem;
  }

  .table-row {
    padding: 12px 15px;
  }

  .model-name {
    font-size: 0.9rem;
  }

  .offer-banner {
    padding: 12px;
  }

  .offer-note {
    font-size: 0.9rem;
  }

  .tradein-terms p {
    font-size: 0.8rem;
  }

  .btn-inquiry {
    padding: 10px 25px;
    font-size: 0.95rem;
  }

  .tradein-process h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .process-steps {
    overflow-x: auto;
    padding-bottom: 15px;
    justify-content: flex-start;
    gap: 15px;
  }

  .step {
    flex: 0 0 120px;
    min-width: 120px;
  }

  .step-icon {
    width: 50px;
    height: 50px;
  }

  .step p {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  /* Apple App Section */
  .apple-app-section {
    padding: 50px 15px;
  }

  .apple-app-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
  }

  .apple-app-subtitle {
    font-size: 1.2rem;
    margin-bottom: 25px;
  }

  .apple-app-container p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* Apple Apps Section */
  .apple-apps-section {
    padding: 50px 15px;
  }

  .apple-apps-container {
    flex-direction: column;
    gap: 30px;
  }

  .apple-apps-left {
    flex: 1 1 100%;
  }

  .apple-apps-left h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
  }

  .apple-apps-left p {
    font-size: 1rem;
  }

  .apple-apps-right {
    flex: 1 1 100%;
    gap: 15px;
  }

  .app-card {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 25px 15px;
  }

  .app-card img {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
  }

  .app-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .app-card p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* Apple Media Section */
  .apple-media-section {
    padding: 50px 15px;
  }

  .apple-media-container {
    flex-direction: column;
    gap: 30px;
  }

  .apple-media-left {
    flex: 1 1 100%;
  }

  .apple-media-left h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
  }

  .apple-media-left p {
    font-size: 1rem;
  }

  .apple-media-right {
    flex: 1 1 100%;
    gap: 15px;
  }

  /* Image Gallery Section */
  .image-gallery-section {
    padding: 40px 15px;
  }

  .image-gallery-section h2 {
    font-size: 1.6rem;
    margin-bottom: 25px;
  }

  .thumbnail-wrapper {
    padding: 0 35px;
  }

  .thumbnail-row {
    gap: 12px;
  }

  .thumbnail {
    width: 90px;
    height: 127px;
  }

  .scroll-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .full-image {
    max-width: 95%;
  }

  /* Apple Financing Hero Section */
  .apple-financing-hero {
    padding: 40px 15px;
  }

  .financing-container {
    flex-direction: column;
    gap: 30px;
  }

  .financing-text {
    flex: 1 1 100%;
    text-align: center;
    order: 2;
  }

  .financing-image {
    flex: 1 1 100%;
    order: 1;
  }

  .financing-text h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }

  .financing-text p {
    font-size: 1rem;
    line-height: 1.5;
    max-width: 100%;
  }

  .financing-image img {
    transform: none;
    max-width: 100%;
  }

  /* Apple Financing Benefits Section */
  .apple-financing-benefits {
    padding: 40px 15px;
  }

  .financing-benefits-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .benefit-box {
    padding: 25px 15px;
  }

  .benefit-box h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  .benefit-box p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* Financing Details Section */
  .financing-details-section {
    padding: 40px 15px;
  }

  .financing-details-container {
    flex-direction: column;
    gap: 30px;
  }

  .financing-details-text {
    flex: 1 1 100%;
    order: 2;
  }

  .financing-details-image {
    flex: 1 1 100%;
    order: 1;
  }

  .financing-details-text h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    margin-top: 20px;
  }

  .financing-details-text p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  /* Apple Buyback Section */
  .apple-buyback-section {
    padding: 40px 15px;
  }

  .buyback-container {
    flex-direction: column;
    gap: 30px;
  }

  .buyback-text {
    flex: 1 1 100%;
    order: 2;
  }

  .buyback-image {
    flex: 1 1 100%;
    order: 1;
  }

  .buyback-text h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    text-align: center;
  }

  .buyback-text p {
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
  }

  /* Touch-friendly improvements */
  button, 
  a.service-card, 
  a.btn-inquiry,
  .thumbnail {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
  }

  /* Add more padding to clickable elements for better touch targets */
  .service-card,
  .tech-feature-item,
  .k12-card,
  .app-card,
  .btn-inquiry {
    padding-top: 15px;
    padding-bottom: 15px;
  }

  /* Improve scrolling experience */
  .process-steps,
  .thumbnail-row {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .step,
  .thumbnail {
    scroll-snap-align: start;
  }

  /* Prevent content overflow */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Improve form factor for iPhone notches */
  .content-container {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* iPhone SE and other very small devices */
@media screen and (max-width: 375px) {
  .apple-auth-badge-topright {
    padding-right: 15px;
  }
  
  .content-container .apple-auth-badge-topright img {
    max-width: 100px;
  }
  
  .page-title {
    font-size: 1.5rem;
  }

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

  .tech-features-grid {
    grid-template-columns: 1fr;
  }

  .app-card {
    padding: 20px 12px;
  }

  /* Smaller font size for values section on very small screens */
  .values-section h2 {
    font-size: 1.2rem;
  }

  .values-section h2 i {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    background: linear-gradient(135deg, #ffffff, #f5f5f7);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05),
                0 0 0 1px rgba(0, 0, 0, 0.02);
  }

  .values-section ul li {
    font-size: 0.9rem;
    margin-bottom: 8px;
    max-width: calc(100% - 15px);
    padding-right: 5px;
  }
  
  .values-right-content .values-section:nth-child(2) ul li {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  /* Adjust padding for values sections */
  .values-card > .values-section:first-child,
  .values-right-content .values-section {
    padding: 20px 15px;
  }
  
  /* Force display for values sections */
  .values-section,
  .values-right-content,
  .values-right-content .values-section {
    display: block !important;
    visibility: visible !important;
  }

  .tradein-hero-content h1 {
    font-size: 1.5rem;
  }

  .tradein-hero-content h2 {
    font-size: 1.2rem;
  }

  .step {
    flex: 0 0 110px;
    min-width: 110px;
  }
}
