/* Repair Page Styles */

body.repair-page {
    background-image: url('../images/1st/walpaper.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    margin: 0;
    padding: 0;
}

.page-main-wrapper {
    padding: 0 50px;
}

.dark-container {
    background: linear-gradient(135deg, #1a2332 0%, #243447 100%);
    padding: 0 0 40px 0;
    min-height: 100vh;
    max-width: 1200px !important;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.repair-container {
    margin: 40px 15px;
    box-sizing: border-box;
}

.back-link-wrapper {
    margin-bottom: 25px;
}

.back-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #007AFF !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
    width: 180px;
    white-space: nowrap;
}

.back-button:hover {
    background: #0051D5 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.back-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Mobile Sticky Back Button */
.mobile-sticky-back {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a2332;
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.mobile-back-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: #007AFF !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.mobile-back-button:hover {
    background: #0051D5 !important;
}

.mobile-back-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Content Wrapper - Gray Box Container */
.content-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.content-box {
    background: #E8E8ED;
    border-radius: 15px;
    padding: 15px 40px 40px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1D1D1F;
    margin: 0 0 10px 0;
    padding-top: 15px;
    text-align: left;
}

.breadcrumb {
    font-size: 14px;
    color: #6E6E73;
    margin-bottom: 15px;
    font-weight: 500;
}

.breadcrumb a {
    color: #6E6E73;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #007AFF;
    text-decoration: underline;
}

.category-count,
.brand-count,
.device-count {
    font-size: 16px;
    color: #6E6E73;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Grid Layouts */
.categories-grid,
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Desktop: 4 device cards per line */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 15px;
}

/* Device Groups */
.device-group {
    width: 100%;
    margin: 3px 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    grid-column: 1 / -1;
}

.device-group h3 {
    background-color: transparent;
    margin: 0 0 15px 0;
    padding: 0;
    border: none;
    font-size: 1.3em;
    color: #007AFF;
    text-align: left;
    font-weight: 600;
}

.device-group .device-list {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    background-color: transparent;
}

.device-group .device-list .device-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
}

/* Card Styles */
.category-card,
.brand-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

/* Device Card - Gray Background */
.device-card {
    background: #F5F5F7;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.category-card:hover,
.brand-card:hover,
.device-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Image Wrapper */
.category-image-wrapper,
.brand-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #F5F5F7;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Device Image Wrapper - Larger Image */
.device-image-wrapper {
    width: 100%;
    min-height: 180px;
    max-height: 250px;
    overflow: hidden;
    background: #F5F5F7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.category-image,
.brand-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Device Image - Larger with Contain */
.device-image {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.category-card:hover .category-image,
.brand-card:hover .brand-image,
.device-card:hover .device-image {
    transform: scale(1.05);
}

/* Info Section */
.category-info,
.brand-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-info {
    padding: 0 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-name,
.brand-name {
    font-size: 18px;
    font-weight: 600;
    color: #1D1D1F;
    line-height: 1.3;
}

.device-name {
    font-size: 15px;
    font-weight: 600;
    color: #1D1D1F;
    line-height: 1.2;
}

.category-action,
.brand-action,
.device-action {
    font-size: 13px;
    color: #007AFF;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* No Items Found */
.no-items {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    margin-top: 30px;
}

.no-items-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-items h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1D1D1F;
    margin: 0 0 10px 0;
}

.no-items p {
    font-size: 16px;
    color: #6E6E73;
    margin: 0;
}

/* Device Header Section */
.device-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.device-header-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.device-header-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.device-header-info {
    flex: 1;
}

.device-header-info .page-title {
    margin: 0 0 5px 0;
    font-size: 28px;
}

.device-header-info .breadcrumb {
    margin: 0;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #1D1D1F;
    margin: 0 0 10px 0;
}

.service-count {
    font-size: 16px;
    color: #6E6E73;
    margin-bottom: 25px;
    font-weight: 500;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

/* Service Card */
.service-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.service-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.service-image-wrapper {
    width: 100%;
    height: 200px;
    background: #F5F5F7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.service-name {
    font-size: 20px;
    font-weight: 600;
    color: #1D1D1F;
    line-height: 1.3;
}

.service-price {
    font-size: 28px;
    font-weight: 700;
    color: #007AFF;
    margin: 5px 0;
}

.service-select-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #007AFF;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    border: none;
}

.service-select-btn:hover {
    background: #0051D5;
    transform: translateY(-1px);
}

/* Quality Options */
.quality-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-label {
    font-size: 14px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 5px;
}

.quality-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #F5F5F7;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.quality-option:hover {
    background: #EBEBED;
}

.quality-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.quality-name {
    font-size: 16px;
    font-weight: 600;
    color: #1D1D1F;
}

.quality-description {
    font-size: 13px;
    color: #6E6E73;
    line-height: 1.4;
}

.quality-warranty {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #34C759;
    font-weight: 500;
    margin-top: 3px;
}

.quality-warranty svg {
    flex-shrink: 0;
}

.quality-price-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.quality-price {
    font-size: 22px;
    font-weight: 700;
    color: #007AFF;
    white-space: nowrap;
}

.quality-select-btn {
    padding: 8px 20px;
    background: #007AFF;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.quality-select-btn:hover {
    background: #0051D5;
}

/* Responsive Design */
/* Large Desktop - 4 cards per line (default above 1400px) */
@media screen and (min-width: 1400px) {
    .devices-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .device-group .device-list {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }
}

/* Medium Desktop - 4 cards per line */
@media screen and (max-width: 1399px) and (min-width: 1025px) {
    .devices-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .device-group .device-list {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }
}

/* Tablet - 3 cards per line */
@media screen and (max-width: 1024px) {
    .page-main-wrapper {
        padding: 0 30px;
    }
    
    .categories-grid,
    .brands-grid,
    .devices-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .device-group .device-list {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 20px;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .content-box {
        padding: 30px;
    }
}

@media screen and (max-width: 768px) {
    .page-main-wrapper {
        padding: 0;
        padding-bottom: 80px; /* Add space for sticky button */
    }
    
    .repair-container {
        margin: 20px 0;
    }
    
    /* Hide desktop back button on mobile */
    .desktop-back {
        display: none;
    }
    
    /* Show mobile sticky back button */
    .mobile-sticky-back {
        display: block;
    }
    
    .content-box {
        padding: 5px 15px 25px 15px;
        margin: 0 5px;
        border-radius: 15px 15px 0 0;
    }
    
    .page-title {
        font-size: 26px;
        padding-top: 5px;
    }
    
    .breadcrumb {
        margin-bottom: 5px;
    }
    
    .categories-grid,
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-top: 5px;
    }
    
    /* Mobile: 2 device cards per line with 5px gap */
    .devices-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
        margin-top: 5px;
        padding: 0 5px;
    }
    
    .device-group .device-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    /* Device cards - vertical layout matching HTML example */
    .device-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 5px;
        border-radius: 16px;
        background: white;
        text-align: center;
    }
    
    .device-image-wrapper {
        min-height: 90px !important;
        max-height: 90px !important;
        height: 90px !important;
        width: 100% !important;
        flex-shrink: 0;
        padding: 3px 0 0 0 !important;
        border-radius: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .device-info {
        flex: 1;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        width: 100%;
    }
    
    .device-image {
        max-height: 90px;
        max-width: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
        margin: auto;
    }
    
    .device-name {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
        color: #1e293b;
    }
    
    .device-action {
        font-size: 12px;
        font-weight: 500;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .device-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
    }
    
    .device-header-image {
        align-self: center;
    }
    
    .device-header-info {
        width: 100%;
        text-align: center;
    }
    
    .quality-option {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quality-price-action {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .back-button {
        width: auto;
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .page-main-wrapper {
        padding: 0;
        padding-bottom: 80px; /* Add space for sticky button */
    }
    
    .repair-container {
        margin: 15px 0;
    }
    
    .content-box {
        padding: 5px 10px 20px 10px;
        margin: 0 5px;
        border-radius: 15px 15px 0 0;
    }
    
    .page-title {
        font-size: 22px;
        padding-top: 5px;
    }
    
    .breadcrumb {
        margin-bottom: 5px;
    }
    
    .categories-grid,
    .brands-grid,
    .devices-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 5px;
    }
    
    .device-group .device-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .device-image-wrapper {
        min-height: 200px;
        max-height: 280px;
        padding: 0;
    }
    
    .device-image {
        max-height: 250px;
    }
    
    .category-info,
    .brand-info {
        padding: 15px;
    }
    
    .device-info {
        padding: 0 5px 5px 5px;
    }
    
    .category-name,
    .brand-name,
    .device-name {
        font-size: 16px;
    }
    
    .device-header-image {
        width: 60px;
        height: 60px;
    }
    
    .device-header-info .page-title {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .service-name {
        font-size: 18px;
    }
    
    .service-price {
        font-size: 24px;
    }
    
    .quality-price {
        font-size: 20px;
    }
    
    .back-button {
        width: 100%;
        max-width: 180px;
    }
}
