﻿/* =====================================================
   LAYOUT
===================================================== */

.details-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    justify-items: center;
}


/* =====================================================
   IMAGE
===================================================== */

.details-image-box {
    background: #f9fafb;
    border-radius: 18px;
}

.image-main {
    width: 100%;
    height: 320px;
    overflow: hidden;
    border-radius: 16px;
}

    .image-main img,
    .details-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 12px;
    }


/* =====================================================
   TOP INFO
===================================================== */

.details-top-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.category-pill {
    background: #e0f2fe;
    color: #0284c7;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.rating {
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}

    .rating i {
        color: #facc15;
    }

.rating-count {
    color: #6b7280;
}


/* =====================================================
   TITLE + RESTAURANT
===================================================== */

.details-restaurant {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #16a34a;
    text-decoration: none;
    margin-bottom: 18px;
    transition: all 0.2s ease;
}

    .details-restaurant:hover {
        color: #0f7c4c;
        transform: translateX(2px);
    }

.details-title {
    font-size: 30px;
    font-weight: 600;
    margin: 10px 0 20px 0;
}

.details-description {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 25px;
}


/* =====================================================
   PRICE
===================================================== */

.details-price-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.details-price {
    font-size: 24px;
    font-weight: 600;
    color: #16a34a;
}

.details-original {
    text-decoration: line-through;
    color: #9ca3af;
}

.details-badge {
    background: #16a34a;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
}


/* =====================================================
   TAGS
===================================================== */

.details-tags {
    margin: 10px 0 15px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-pill {
    background: #e6f4ea;
    color: #1a7f3c;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: 0.2s;
}

    .tag-pill:hover {
        background: #1a7f3c;
        color: white;
    }


/* =====================================================
   QUANTITY + STOCK
===================================================== */

/* Disabled button if you are not valid */
.disabled-btn {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none; /* 🔥 това спира клика */
    background: green;
}

.details-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 18px;
    transition: 0.2s;
}

    .qty-btn:hover {
        background: #e5e7eb;
    }

.qty-display {
    width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    font-size: 13px;
}

.stock-status {
    color: #16a34a;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-count {
    color: #6b7280;
    font-weight: 500;
}

.out-of-stock {
    color: #dc2626;
    font-weight: 600;
}


/* =====================================================
   BUTTON
===================================================== */

.add-btn {
    background: #149b5f;
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

    .add-btn:hover {
        background: #0f7c4c;
        transform: translateY(-1px);
    }

    .add-btn.full {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        border-radius: 14px;
    }

    .add-btn:focus {
        outline: none;
        box-shadow: none;
    }


/* =====================================================
   TIMER
===================================================== */

.details-timer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 15px 0 10px 0;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 12px;
}

#countdown {
    font-size: 15px;
    font-weight: 600;
    color: #16a34a;
    display: flex;
    align-items: center;
    gap: 6px;
}

    #countdown::before {
        content: "⏳";
    }

.ends-date {
    font-size: 12px;
    color: #6b7280;
    margin-left: 22px;
}


/* =====================================================
   FEATURES
===================================================== */

.details-features {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    font-size: 13px;
    color: #6b7280;
}

    .details-features i {
        margin-right: 6px;
        color: #16a34a;
    }


/* =====================================================
   TABS
===================================================== */

.details-tabs {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 50px;
    background: #f9fafb;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    min-height: 400px;
}

.tabs-nav {
    display: flex;
    gap: 25px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 0;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: 0.2s;
}

    .tab-btn.active {
        color: #16a34a;
        border-bottom: 2px solid #16a34a;
    }

.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }


/* =====================================================
   RESTAURANT CARD
===================================================== */

.restaurant-info-card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    margin-top: 40px;
}

.ric-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 15px;
}

.ric-avatar {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    overflow: hidden;
    background: #f3f4f6;
}

    .ric-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.ric-title {
    font-size: 20px;
    font-weight: 700;
}

.ric-sub {
    font-size: 14px;
    color: #6b7280;
}

.ric-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.ric-contact-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

    .ric-contact-item i {
        font-size: 18px;
        color: #16a34a;
        margin-top: 3px;
    }

    .ric-contact-item .label {
        font-size: 12px;
        color: #6b7280;
    }

    .ric-contact-item .value {
        font-weight: 600;
        color: #111827;
    }

    .ric-contact-item a {
        color: inherit;
        text-decoration: none;
    }

        .ric-contact-item a:hover {
            text-decoration: underline;
        }


/* =====================================================
   REVIEWS
===================================================== */

/* ⭐ FIXED summary stars */
.stars i {
    color: #facc15;
    font-size: 18px;
    margin-right: 2px;
}

.reviews-list {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}

    .reviews-list::-webkit-scrollbar {
        width: 6px;
    }

    .reviews-list::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 10px;
    }

.review-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #f1f5f9;
    transition: 0.2s;
}

    .review-card:hover {
        box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    }

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.review-user {
    display: flex;
    gap: 10px;
    align-items: center;
}

.avatar {
    width: 38px;
    height: 38px;
    background: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-name {
    font-weight: 600;
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: #6b7280;
}

.review-stars i {
    color: #facc15;
    font-size: 16px;
}

.review-text {
    font-size: 14px;
    color: #374151;
}

.verified {
    font-size: 11px;
    color: #16a34a;
    margin-left: 6px;
}

/* =========================
   HORIZONTAL REVIEW SUMMARY
========================= */

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.rs-score {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.rs-stars {
    display: flex;
    gap: 4px;
}

    .rs-stars i {
        font-size: 18px;
        color: #f59e0b;
    }

.rs-count {
    font-size: 14px;
    color: #6b7280;
}

.reviews-count {
    font-size: 14px;
    color: #6b7280;
}

/* =====================================================
   DELIVERY
===================================================== */

.delivery-grid {
    display: grid;
    grid-template-columns: repeat(2, 420px);
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
}

/* =========================
   DELIVERY CARDS UPGRADE
========================= */

.delivery-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border: 1px solid #f1f5f9;
    position: relative;
    transition: all 0.2s ease;
}

    /* hover = лек lift */
    .delivery-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    }

    /* ICON */
    .delivery-item i {
        font-size: 20px;
        margin-top: 2px;
    }

    /* TITLE */
    .delivery-item .title {
        font-weight: 600;
        font-size: 15px;
    }

    /* DESC */
    .delivery-item .desc {
        font-size: 13px;
        color: #6b7280;
    }


/* =========================
   COLORED BORDER SYSTEM
========================= */

/* зелено (default бранд) */
.highlight-green {
    border-left: 4px solid #16a34a;
}

    .highlight-green i {
        color: #16a34a;
    }

/* синьо */
.highlight-blue {
    border-left: 4px solid #2563eb;
}

    .highlight-blue i {
        color: #2563eb;
    }

/* оранжево */
.highlight-orange {
    border-left: 4px solid #f59e0b;
}

    .highlight-orange i {
        color: #f59e0b;
    }

/* лилаво */
.highlight-purple {
    border-left: 4px solid #7c3aed;
}

.highlight-purple i {
    color: #7c3aed;
}

/* RELATED OFFERS CAROUSEL */

.related-offers-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e5e7eb;
}

.related-header {
    margin-bottom: 24px;
}

.related-title {
    font-size: 22px;
    font-weight: 700;
}

.related-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.related-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 8px 4px;
    flex: 1;
}

    .related-carousel::-webkit-scrollbar {
        display: none;
    }

.related-card {
    min-width: 220px;
    max-width: 220px;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    text-decoration: none;
    color: inherit;
    transition: .2s;
    flex-shrink: 0;
}

    .related-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(0,0,0,.13);
    }

.related-image {
    position: relative;
}

    .related-image img {
        width: 100%;
        height: 140px;
        object-fit: cover;
    }

.related-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #16a34a;
    color: white;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
}

.related-info {
    padding: 14px;
}

.related-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-prices {
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-price-new {
    font-size: 16px;
    font-weight: 700;
    color: #16a34a;
}

.related-price-old {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
}

.carousel-arrow {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #374151;
    flex-shrink: 0;
    transition: .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

    .carousel-arrow:hover {
        background: #f3f4f6;
    }

@media (max-width: 1000px) {

    .details-wrapper {
        padding: 30px 10px;
    }

    .details-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        justify-items: center;
    }

        .details-image-box img {
            max-width: 100%;
            height: auto;
        }

    .details-top-row {
        justify-content: center;
    }

    .details-info {
        display: flex;
        flex-direction: column;
        text-align: center;
        width: 100%;
    }

    .details-title, .details-restaurant, .details-description {
        text-align: center;
    }

    .details-price-section,
    .details-quantity,
    .details-restaurant,
    #countdown {
        justify-content: center;
    }

    .add-to-cart-form button {
        width: 100%;
    }

    /* Adjust for mobile view with small text and image centering */
    .details-title {
        font-size: 26px;
    }

    .details-description {
        font-size: 14px;
    }

    .details-price,
    .details-original {
        font-size: 20px;
    }

    .details-badge {
        font-size: 14px;
    }

    .stock-info {
        font-size: 12px;
    }

    .details-features {
        font-size: 12px;
    }
}

@media (max-width: 560px) {
    .image-main {
        height: auto;
    }
    .details-top-row {
        margin-top: 0.5cm;
    }
}

@media (max-width: 500px) {
    .details-title {
        font-size: 23px;
    }
}

@media (max-width: 410px) {
    #addToCartForm, .details-timer {
        width: 350px;
        align-self: center;
    }
    .details-features {
        flex-direction: column;
        gap: 0.5cm;
    }
    .details-description, .details-title {
        padding: 0 20px;
    }
}

/* Info pages */

/* Ensuring the tabs stack on smaller screens */
@media (max-width: 768px) {

    .details-tabs {
        padding: 30px 10px;
    }
    .tab-btn {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        text-align: left;
    }

        .tab-btn.active {
            border-bottom: none;
        }

    .tab-content {
        padding: 15px;
    }
}

@media (max-width: 515px) {
    .tab-btn {
        text-align: center;
        font-size: 12px;
    }
}

/* Ensuring the restaurant info card is well-structured */
@media (max-width: 1000px) {
    .restaurant-info-card {
        padding: 20px;
        margin-top: 25px;
    }

    .ric-header {
        flex-direction: column;
        align-items: center;
    }

    .ric-title {
        font-size: 24px;
        text-align: center;
    }

    .ric-sub {
        font-size: 14px;
        color: #6b7280;
        text-align: center;
    }

    .ric-contact-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ric-contact-item i {
            font-size: 22px;
        }
}

/* Review section tweaks for mobile screens */
@media (max-width: 768px) {
    .reviews-summary {
        flex-direction: column;
        text-align: center;
    }

    .rs-score {
        font-size: 28px;
    }

    .rs-stars {
        margin-bottom: 10px;
    }

    .rs-count {
        font-size: 14px;
    }

    .review-card {
        margin-bottom: 15px;
    }

    .review-user {
        flex-direction: column;
        align-items: center;
    }

    .review-name {
        font-size: 16px;
    }

    .review-date {
        font-size: 12px;
    }
}

/* Delivery section adjustments */
@media (max-width: 1000px) {
    .delivery-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .delivery-item {
        padding: 12px;
        text-align: center;
    }

        .delivery-item i {
            font-size: 24px;
        }

        .delivery-item .title {
            font-size: 16px;
        }

        .delivery-item .desc {
            font-size: 14px;
        }
}

/* General responsiveness for very small screens */
@media (max-width: 500px) {
    .details-wrapper {
        padding: 20px;
    }

    .details-title {
        font-size: 22px;
    }

    .details-description {
        font-size: 12px;
        padding: 0 15px;
    }

    .details-price-section {
        flex-direction: column;
        align-items: center;
    }

    .add-btn {
        width: 100%;
    }

    .details-tags {
        justify-content: center;
    }

    .tag-pill {
        padding: 4px 8px;
        font-size: 12px;
    }
}