/* ============================================
   CUSTOM PRODUCT DESCRIPTION STYLES
   No Bootstrap Required - Product Pages Only
   ============================================ */

/* Tab Navigation Styles */
.tabs-container {
    width: 100%;
    margin: 20px 0;
    clear: both;
}

#detailTab {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e5e5;
}

.nav-justified-li {
    flex: 1;
    text-align: center;
}

.nav-justified-li a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-justified-li a:hover {
    background: #e8e8e8;
    color: #333;
}

.nav-justified-li.active a {
    background: #0066ff;
    color: #fff;
    border-color: #0066ff;
}

/* Tab Content Styles */
.tab-contents {
    display: block;
    width: 100%;
    clear: both;
    float: none;
    overflow: hidden; /* Contains internal floats */
}

.related.products, 
.upsells.products {
    clear: both !important;
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin-top: 40px; /* Optional: adds some breathing room */
}

/* Specific fix for the active tab pane */

.tab-pane {
    display: none;
    padding: 30px 20px;
    animation: fadeIn 0.3s ease-in;
}

.tab-pane.active {
    display: block;
    width: 100%;
    clear: both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Panel Body */
.panel-body {
    padding: 20px;
    background: #fff;
}

.panel-body h2,
.panel-body h3,
.panel-body h4 {
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Section Headers with Blue Background */
.section-header-blue {
    display: inline-block;
    padding: 10px 30px;
    background: #0066ff;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    border-radius: 0 20px 20px 0;
    margin: 20px 0;
}

/* Product Description Content */
.product-intro-text {
    font-size: 14px;
    color: #525252;
    line-height: 22px;
    margin: 30px 0;
}

/* Product Section Layouts */
.product-description-section {
    position: relative;
    width: 100%;
    max-width: 905px;
    margin: 100px auto 30px;
    padding: 60px 30px 40px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

/* Section Headers positioned outside */
.product-description-section .section-title {
    position: absolute;
    left: 0;
    top: -20px;
    width: 194px;
    height: 40px;
    font-size: 18px;
    color: #fff;
    line-height: 40px;
    background-color: #0066ff;
    text-align: center;
    font-weight: bold;
    border-radius: 0 20px 20px 0;
}

/* Tent Top Section */
.tent-top-content {
    margin-bottom: 30px;
}

.tent-top-heading {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.tent-top-description {
    font-size: 14px;
    color: #525252;
    line-height: 24px;
    margin-bottom: 20px;
    max-width: 410px;
}

/* Product Image Display */
.product-image-display {
    text-align: center;
    margin: 30px 0;
}

.product-image-display img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* Feature Icons Grid */
.feature-icons-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 30px 0;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.feature-icon-box {
    text-align: center;
    padding: 20px 10px;
    border-right: 1px solid #ccc;
}

.feature-icon-box:last-child {
    border-right: none;
}

.feature-icon-box img {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    display: block;
}

.feature-icon-label {
    font-size: 14px;
    color: #333;
    line-height: 16px;
}

/* Various Package Section */
.package-section-title {
    font-size: 18px;
    font-weight: bold;
    color: #009688;
    margin: 30px 0 15px;
}

.package-description {
    font-size: 14px;
    color: #525252;
    line-height: 22px;
    margin-bottom: 20px;
}

.package-description a {
    color: #00a7d4;
    text-decoration: none;
}

.package-description a:hover {
    text-decoration: underline;
}

/* Package Options Grid */
.package-options-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.package-option-box {
    text-align: center;
}

.package-option-box img {
    width: 100%;
    max-width: 180px;
    height: 160px;
    object-fit: contain;
    margin: 0 auto 15px;
    display: block;
}

.package-option-label {
    font-size: 14px;
    color: #333;
    line-height: 16px;
}

/* Frame Specifications */
.frame-specs-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
    margin: 30px 0;
}

.frame-spec-box {
    text-align: center;
}

.frame-spec-box img {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    display: block;
}

.frame-spec-details {
    font-size: 14px;
    color: #333;
    line-height: 20px;
    text-align: center;
}

.frame-spec-details strong {
    display: block;
    margin-bottom: 8px;
}

.frame-diagram {
    text-align: center;
}

.frame-diagram img {
    max-width: 100%;
    height: auto;
}

/* Accessories Grid */
.accessories-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.accessory-box {
    text-align: center;
}

.accessory-box img {
    width: 100%;
    max-width: 210px;
    height: 130px;
    object-fit: contain;
    margin: 0 auto 10px;
    display: block;
}

.accessory-label {
    font-size: 14px;
    color: #333;
    text-align: center;
}

.accessory-label a {
    color: #04ace2;
    text-decoration: none;
}

.accessory-label a:hover {
    text-decoration: underline;
}

/* Questions & Answers Section */
.qa-section-container {
    background: transparent;
    padding: 0;
    margin: 40px 0;
}

.qa-section-header {
    display: inline-block;
    padding: 10px 40px;
    background: #00bcd4;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    border-radius: 20px;
    margin-bottom: 30px;
}

.qa-content-box {
    background: #f5f5f5;
    padding: 30px;
    border-radius: 8px;
}

.qa-item {
    margin-bottom: 25px;
}

.qa-item:last-child {
    margin-bottom: 0;
}

.qa-question {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.qa-answer {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
    margin: 0;
}

/* Artwork Requirements Section */
.artwork-section {
    margin: 40px 0;
}

.artwork-section h4 {
    font-size: 20px;
    font-weight: bold;
    color: #009688;
    margin-bottom: 20px;
}

.artwork-section p {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.artwork-section ol,
.artwork-section ul {
    margin-left: 20px;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

.artwork-section a {
    color: #00a7d4;
    text-decoration: none;
}

.artwork-section a:hover {
    text-decoration: underline;
}

.notice-red {
    color: #ff0000;
    font-weight: bold;
    background: #fff3cd;
    padding: 15px;
    border-left: 4px solid #ff0000;
    margin: 20px 0;
}

/* Template Section */
.template-section {
    margin: 40px 0;
}

.template-section h4 {
    font-size: 18px;
    font-weight: bold;
    color: #009688;
    margin-bottom: 10px;
}

.template-note {
    color: #009688;
    font-size: 14px;
    margin-bottom: 30px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin: 30px 0;
}

.template-item {
    text-align: center;
}

.template-item h5 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.template-downloads {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.template-download-link {
    display: inline-block;
}

.template-download-link img {
    width: 80px;
    height: 100px;
    display: block;
}

/* Instruction Section */
.instruction-section {
    margin: 40px 0;
}

.instruction-section h4 {
    font-size: 18px;
    font-weight: bold;
    color: #009688;
    margin-bottom: 10px;
}

.instruction-note {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Production and Delivery Sections */
.production-delivery-section h4 {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 30px 0 15px;
}

.production-delivery-section p {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 10px;
}

.production-delivery-section span {
    display: block;
    margin: 5px 0;
}

.production-delivery-section a {
    color: #00a7d4;
    text-decoration: none;
    font-style: italic;
}

.production-delivery-section a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-description-section {
        max-width: 100%;
        margin-top: 80px;
    }
}

@media (max-width: 768px) {
    #detailTab {
        flex-direction: column;
    }
    
    .nav-justified-li {
        width: 100%;
    }
    
    .feature-icons-container,
    .package-options-container,
    .accessories-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .frame-specs-container {
        grid-template-columns: 1fr;
    }
    
    .product-description-section {
        padding: 40px 20px 30px;
        margin-top: 60px;
    }
    
    .tent-top-description {
        max-width: 100%;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .ulNewClass li {
        flex: 0 0 100%;
    }
}

@media (max-width: 480px) {
    .feature-icons-container,
    .package-options-container,
    .accessories-container {
        grid-template-columns: 1fr;
    }
    
    .nav-justified-li a {
        font-size: 14px;
        padding: 12px 10px;
    }
    
    .product-description-section {
        padding: 30px 15px 20px;
    }
    
    .section-title {
        font-size: 16px !important;
        width: 160px !important;
        padding: 8px 15px !important;
    }
}

/* Clear floats */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================
   TEMPLATE TAB SPECIFIC STYLES
   ============================================ */

/* Fix excessive line breaks in Template tab */
.tab-pane p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.tab-pane p br {
    display: block;
    content: "";
    margin: 3px 0;
}

.tab-pane span {
    display: inline;
}

/* Artwork Requirements styling */
.panel-body h4 {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 25px 0 15px;
}

.panel-body h4 .blue {
    color: #009688;
}

.panel-body h4 small {
    display: block;
    font-size: 14px;
    color: #666;
    font-weight: normal;
    margin-top: 5px;
}

/* Template download list */
.ulNewClass {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.ulNewClass li {
    flex: 0 0 calc(50% - 10px);
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.ulNewClass li.backwhite {
    background: #fafafa;
}

/* Template item heading */
.h4NewClass {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

/* Download icons container */
.pro_tpl_down {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
}

.pro_tpl_down.dflex {
    display: flex;
}

.pro_tpl_down a {
    display: inline-block;
    transition: transform 0.2s ease;
}

.pro_tpl_down a:hover {
    transform: scale(1.05);
}

.pro_tpl_down img {
    width: 80px;
    height: 80px;
    display: block;
}

/* Bootstrap grid replacement for template tab */
.col-md-6 {
    width: 100%;
}

.col-md-12 {
    width: 100%;
    padding: 0;
}

.pull-left {
    float: none;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Red notice text */
span[style*="color: #FF0000"],
span[style*="color:#FF0000"] {
    color: #ff0000 !important;
    display: block;
    margin: 15px 0;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ff0000;
}

/* Reduce spacing between paragraphs in template tab */
#tab-3 p {
    margin-bottom: 8px;
}

#tab-3 p br + span {
    display: block;
    margin-top: 5px;
}

/* Production and Delivery sections spacing fix */
.panel-body > div > p {
    margin-bottom: 8px;
}

.panel-body > div > p br {
    display: block;
    content: "";
    margin: 2px 0;
}

.panel-body > div > p span {
    display: block;
    margin: 3px 0;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.float-left {
    float: left;
}

.float-right {
    float: right;
}

/* ============================================
   IMPROVED MOBILE ALIGNMENT FIXES
   ============================================ */

@media (max-width: 768px) {
    /* 1. Reset the main container to use full screen width */
    .product-description-section {
        margin: 20px 0 !important;
        padding: 30px 10px 15px !important; 
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 2. Fix the "Empty Space" on the left by forcing text alignment */
    .product-description-section *,
    .tab-pane *,
    .panel-body * {
        margin-left: 0 !important;
        padding-left: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 3. Re-align the blue section headers correctly */
    .product-description-section .section-title {
        position: relative !important;
        top: 0 !important;
        left: -10px !important; /* Slight bleed to the left for aesthetics */
        margin: 0 0 20px 0 !important;
        display: inline-block !important;
        width: auto !important;
        padding: 8px 25px !important;
        border-radius: 0 20px 20px 0 !important;
        white-space: nowrap;
    }

    /* 4. Fix hidden/overflowing content in the Description tab */
    .tab-pane {
        padding: 15px 5px !important;
        overflow-x: hidden !important; /* Prevents side-scrolling the whole page */
    }

    /* 5. Ensure images fit within the screen */
    .product-image-display img,
    .tab-pane img {
        height: auto !important;
        max-width: 100% !important;
        display: block;
        margin: 10px auto !important;
    }

    /* 6. Fix for Specifications Table (Enables horizontal scroll for data) */
    .tab-pane table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-top: 20px !important;
    }

    /* 7. Stack the Template download boxes vertically */
    .ulNewClass li {
        flex: 0 0 100% !important;
        margin-bottom: 15px !important;
        padding: 15px !important;
    }
}