templates/home/shop.html.twig line 1

Open in your IDE?
  1. {% extends 'base_home.html.twig' %}
  2. {% block title %}
  3.     {{ shop.name }}
  4.     | MaketOu
  5. {% endblock %}
  6. {% block stylesheets %}
  7.     <style>
  8.         /* Design eBay-like intégré avec Karma - Pleine largeur */
  9.         .shop-header {
  10.             background: #f7f7f7;
  11.             border-bottom: 1px solid #e1e1e1;
  12.             padding: 0;
  13.             margin-bottom: 0;
  14.             width: 100%;
  15.             position: relative;
  16.         }
  17.         .shop-banner {
  18.             width: 100%;
  19.             height: 350px;
  20.             background-size: cover;
  21.             background-position: center;
  22.             background-repeat: no-repeat;
  23.             position: relative;
  24.             display: flex;
  25.             align-items: center;
  26.             justify-content: center;
  27.         }
  28.         /* Carrousel eBay-style - même largeur que shop-header-content */
  29.         .shop-carousel-ebay {
  30.             width: 100%;
  31.             height: 400px;
  32.             position: relative;
  33.             overflow: hidden;
  34.             background: #f8f9fa;
  35.             margin: 0 20px 0 20px;
  36.             border-radius: 8px;
  37.             box-sizing: border-box;
  38.         }
  39.         .carousel-container {
  40.             position: relative;
  41.             width: 100%;
  42.             height: 100%;
  43.         }
  44.         .carousel-slide {
  45.             position: absolute;
  46.             top: 0;
  47.             left: 0;
  48.             width: 100%;
  49.             height: 100%;
  50.             background-size: cover;
  51.             background-position: center;
  52.             background-repeat: no-repeat;
  53.             opacity: 0;
  54.             transition: opacity 0.5s ease-in-out;
  55.         }
  56.         .carousel-slide.active {
  57.             opacity: 1;
  58.         }
  59.         .carousel-controls {
  60.             position: absolute;
  61.             bottom: 20px;
  62.             left: 50%;
  63.             transform: translateX(-50%);
  64.             display: flex;
  65.             gap: 10px;
  66.             z-index: 10;
  67.         }
  68.         .carousel-btn {
  69.             width: 40px;
  70.             height: 40px;
  71.             border: none;
  72.             border-radius: 50%;
  73.             background: rgba(255, 255, 255, 0.9);
  74.             color: #333;
  75.             font-size: 16px;
  76.             cursor: pointer;
  77.             display: flex;
  78.             align-items: center;
  79.             justify-content: center;
  80.             transition: all 0.3s ease;
  81.             box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  82.         }
  83.         .carousel-btn:hover {
  84.             background: white;
  85.             transform: scale(1.1);
  86.         }
  87.         .carousel-btn:disabled {
  88.             opacity: 0.5;
  89.             cursor: not-allowed;
  90.             transform: none;
  91.         }
  92.         .carousel-pause {
  93.             background: #dc3545;
  94.             color: white;
  95.         }
  96.         .carousel-pause:hover {
  97.             background: #c82333;
  98.         }
  99.         .carousel-indicators {
  100.             position: absolute;
  101.             bottom: 70px;
  102.             left: 50%;
  103.             transform: translateX(-50%);
  104.             display: flex;
  105.             gap: 8px;
  106.             z-index: 10;
  107.         }
  108.         .carousel-indicator {
  109.             width: 12px;
  110.             height: 12px;
  111.             border-radius: 50%;
  112.             background: rgba(255, 255, 255, 0.5);
  113.             border: none;
  114.             cursor: pointer;
  115.             transition: all 0.3s ease;
  116.         }
  117.         .carousel-indicator.active {
  118.             background: white;
  119.             transform: scale(1.2);
  120.         }
  121.         /* Contrôles eBay-style intégrés */
  122.         .carousel-controls-ebay {
  123.             position: absolute;
  124.             top: 50%;
  125.             left: 0;
  126.             right: 0;
  127.             transform: translateY(-50%);
  128.             display: flex;
  129.             justify-content: space-between;
  130.             padding: 0 20px;
  131.             z-index: 10;
  132.         }
  133.         .carousel-btn-ebay {
  134.             width: 50px;
  135.             height: 50px;
  136.             border: none;
  137.             border-radius: 50%;
  138.             background: rgba(0, 0, 0, 0.7);
  139.             color: white;
  140.             font-size: 18px;
  141.             cursor: pointer;
  142.             display: flex;
  143.             align-items: center;
  144.             justify-content: center;
  145.             transition: all 0.3s ease;
  146.             opacity: 0;
  147.         }
  148.         .shop-carousel-ebay:hover .carousel-btn-ebay {
  149.             opacity: 1;
  150.         }
  151.         .carousel-btn-ebay:hover {
  152.             background: rgba(0, 0, 0, 0.9);
  153.             transform: scale(1.1);
  154.         }
  155.         .carousel-btn-ebay:disabled {
  156.             opacity: 0.3;
  157.             cursor: not-allowed;
  158.             transform: none;
  159.         }
  160.         .carousel-btn-ebay.pause-btn {
  161.             background: rgba(220, 53, 69, 0.8);
  162.         }
  163.         .carousel-btn-ebay.pause-btn:hover {
  164.             background: rgba(220, 53, 69, 1);
  165.         }
  166.         /* Indicateurs eBay-style */
  167.         .carousel-indicators-ebay {
  168.             position: absolute;
  169.             bottom: 20px;
  170.             left: 50%;
  171.             transform: translateX(-50%);
  172.             display: flex;
  173.             gap: 8px;
  174.             z-index: 10;
  175.         }
  176.         .carousel-indicator-ebay {
  177.             width: 12px;
  178.             height: 12px;
  179.             border-radius: 50%;
  180.             background: rgba(255, 255, 255, 0.5);
  181.             border: 2px solid rgba(255, 255, 255, 0.8);
  182.             cursor: pointer;
  183.             transition: all 0.3s ease;
  184.         }
  185.         .carousel-indicator-ebay.active {
  186.             background: white;
  187.             border-color: white;
  188.             transform: scale(1.2);
  189.         }
  190.         .carousel-indicator-ebay:hover {
  191.             background: rgba(255, 255, 255, 0.8);
  192.             transform: scale(1.1);
  193.         }
  194.         /* Styles eBay-style pour les détails de boutique */
  195.         .shop-avatar-container-ebay {
  196.             position: relative;
  197.             margin-right: 20px;
  198.         }
  199.         .shop-avatar-ebay {
  200.             width: 80px;
  201.             height: 80px;
  202.             border-radius: 8px;
  203.             object-fit: cover;
  204.             border: 3px solid white;
  205.             box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  206.         }
  207.         .verified-badge-ebay {
  208.             position: absolute;
  209.             bottom: -5px;
  210.             right: -5px;
  211.             background: #28a745;
  212.             color: white;
  213.             width: 24px;
  214.             height: 24px;
  215.             border-radius: 50%;
  216.             display: flex;
  217.             align-items: center;
  218.             justify-content: center;
  219.             font-size: 12px;
  220.             border: 2px solid white;
  221.         }
  222.         .shop-info-ebay {
  223.             padding: 10px 0;
  224.         }
  225.         .shop-name-section {
  226.             margin-bottom: 8px;
  227.         }
  228.         .shop-name-ebay {
  229.             font-size: 1.8rem;
  230.             font-weight: 600;
  231.             color: #333;
  232.             margin: 0 15px 0 0;
  233.             display: inline-block;
  234.         }
  235.         .verified-text {
  236.             color: #28a745;
  237.             font-size: 0.9rem;
  238.             font-weight: 500;
  239.         }
  240.         .shop-category-section {
  241.             margin-bottom: 12px;
  242.         }
  243.         .shop-category-ebay {
  244.             background: #f8f9fa;
  245.             color: #666;
  246.             padding: 4px 12px;
  247.             border-radius: 16px;
  248.             font-size: 0.85rem;
  249.             font-weight: 500;
  250.         }
  251.         .shop-stats-ebay {
  252.             margin-top: 15px;
  253.         }
  254.         .stat-row {
  255.             display: flex;
  256.             gap: 30px;
  257.             margin-bottom: 10px;
  258.         }
  259.         .stat-item-ebay {
  260.             display: flex;
  261.             flex-direction: column;
  262.             align-items: flex-start;
  263.         }
  264.         .stat-percentage {
  265.             font-size: 1.2rem;
  266.             font-weight: 700;
  267.             color: #28a745;
  268.             line-height: 1;
  269.         }
  270.         .stat-number-ebay {
  271.             font-size: 1.2rem;
  272.             font-weight: 700;
  273.             color: #333;
  274.             line-height: 1;
  275.         }
  276.         .stat-label-ebay {
  277.             font-size: 0.8rem;
  278.             color: #666;
  279.             text-transform: uppercase;
  280.             letter-spacing: 0.5px;
  281.             margin-top: 2px;
  282.         }
  283.         .shop-additional-info {
  284.             display: flex;
  285.             gap: 20px;
  286.             font-size: 0.85rem;
  287.             color: #666;
  288.         }
  289.         .member-since {
  290.             font-weight: 400;
  291.         }
  292.         .location {
  293.             display: flex;
  294.             align-items: center;
  295.         }
  296.         .shop-actions-ebay {
  297.             display: flex;
  298.             flex-direction: column;
  299.             gap: 10px;
  300.             min-width: 140px;
  301.         }
  302.         .btn-ebay {
  303.             padding: 8px 16px;
  304.             font-size: 0.9rem;
  305.             font-weight: 500;
  306.             border-radius: 4px;
  307.             text-align: center;
  308.             transition: all 0.3s ease;
  309.             border-width: 1px;
  310.         }
  311.         .btn-ebay:hover {
  312.             transform: translateY(-1px);
  313.             box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  314.         }
  315.         .btn-ebay.following {
  316.             background: #28a745;
  317.             border-color: #28a745;
  318.             color: white;
  319.         }
  320.         /* Styles pour les avis */
  321.         .review-stats {
  322.             background: white;
  323.             border-radius: 12px;
  324.             padding: 20px;
  325.             box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  326.             margin-bottom: 20px;
  327.         }
  328.         .stat-card {
  329.             padding: 15px;
  330.         }
  331.         .stat-number {
  332.             font-size: 2.5rem;
  333.             font-weight: 700;
  334.             color: #333;
  335.             margin: 0;
  336.         }
  337.         .stat-label {
  338.             color: #666;
  339.             font-size: 0.9rem;
  340.             margin: 5px 0 0;
  341.         }
  342.         .rating-stars {
  343.             color: #ffc107;
  344.             font-size: 1.2rem;
  345.             margin: 10px 0;
  346.         }
  347.         .reviews-preview {
  348.             background: white;
  349.             border-radius: 12px;
  350.             padding: 20px;
  351.             box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  352.         }
  353.         .review-item {
  354.             border-bottom: 1px solid #f0f0f0;
  355.             padding: 15px 0;
  356.         }
  357.         .review-item:last-child {
  358.             border-bottom: none;
  359.         }
  360.         .review-header {
  361.             display: flex;
  362.             justify-content: space-between;
  363.             align-items: flex-start;
  364.             margin-bottom: 10px;
  365.         }
  366.         .reviewer-info {
  367.             display: flex;
  368.             align-items: center;
  369.             gap: 10px;
  370.         }
  371.         .reviewer-avatar {
  372.             width: 40px;
  373.             height: 40px;
  374.             border-radius: 50%;
  375.             background: #f8f9fa;
  376.             display: flex;
  377.             align-items: center;
  378.             justify-content: center;
  379.             color: #666;
  380.         }
  381.         .reviewer-name {
  382.             margin: 0;
  383.             font-size: 1rem;
  384.             font-weight: 600;
  385.         }
  386.         .review-rating {
  387.             color: #ffc107;
  388.             font-size: 0.9rem;
  389.         }
  390.         .review-meta {
  391.             text-align: right;
  392.         }
  393.         .review-date {
  394.             color: #666;
  395.             font-size: 0.8rem;
  396.         }
  397.         .verified-badge {
  398.             display: inline-block;
  399.             background: #28a745;
  400.             color: white;
  401.             padding: 2px 8px;
  402.             border-radius: 12px;
  403.             font-size: 0.7rem;
  404.             margin-left: 10px;
  405.         }
  406.         .review-comment {
  407.             margin: 10px 0 0;
  408.             line-height: 1.5;
  409.             color: #333;
  410.         }
  411.         .review-actions-card {
  412.             background: white;
  413.             border-radius: 12px;
  414.             padding: 20px;
  415.             box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  416.             text-align: center;
  417.         }
  418.         .shop-banner-overlay {
  419.             position: absolute;
  420.             top: 0;
  421.             left: 0;
  422.             right: 0;
  423.             bottom: 0;
  424.             background: rgba(0, 0, 0, 0.3);
  425.             z-index: 1;
  426.         }
  427.         .shop-header-content {
  428.             background: white;
  429.             border: 1px solid #e1e1e1;
  430.             border-radius: 4px;
  431.             padding: 20px;
  432.             margin: 0 20px 20px;
  433.             box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  434.             position: relative;
  435.             z-index: 2;
  436.         }
  437.         .shop-avatar {
  438.             width: 80px;
  439.             height: 80px;
  440.             border-radius: 4px;
  441.             border: 1px solid #e1e1e1;
  442.             object-fit: cover;
  443.             position: relative;
  444.             z-index: 3;
  445.         }
  446.         .shop-title {
  447.             font-size: 1.5rem;
  448.             font-weight: 600;
  449.             color: #333;
  450.             margin-bottom: 8px;
  451.         }
  452.         .shop-subtitle {
  453.             color: #666;
  454.             font-size: 0.9rem;
  455.             margin-bottom: 15px;
  456.         }
  457.         .shop-stats-row {
  458.             display: flex;
  459.             align-items: center;
  460.             gap: 20px;
  461.             flex-wrap: wrap;
  462.             margin-bottom: 15px;
  463.         }
  464.         .shop-stat-item {
  465.             display: flex;
  466.             align-items: center;
  467.             gap: 5px;
  468.             font-size: 0.9rem;
  469.         }
  470.         .positive-feedback {
  471.             color: #007bff;
  472.             font-weight: 600;
  473.         }
  474.         .items-sold {
  475.             color: #666;
  476.         }
  477.         .followers-count {
  478.             color: #666;
  479.         }
  480.         .shop-badges {
  481.             display: flex;
  482.             gap: 10px;
  483.             margin-bottom: 15px;
  484.         }
  485.         .shop-badge {
  486.             background: #f0f0f0;
  487.             color: #333;
  488.             padding: 4px 8px;
  489.             border-radius: 3px;
  490.             font-size: 0.8rem;
  491.             font-weight: 500;
  492.         }
  493.         .shop-badge.verified {
  494.             background: #d4edda;
  495.             color: #155724;
  496.         }
  497.         .shop-badge.premium {
  498.             background: #fff3cd;
  499.             color: #856404;
  500.         }
  501.         .shop-actions-row {
  502.             display: flex;
  503.             align-items: center;
  504.             gap: 15px;
  505.             flex-wrap: wrap;
  506.         }
  507.         .shop-action-btn {
  508.             background: #007bff;
  509.             color: white;
  510.             border: none;
  511.             padding: 8px 16px;
  512.             border-radius: 3px;
  513.             font-size: 0.9rem;
  514.             font-weight: 500;
  515.             cursor: pointer;
  516.             transition: background-color 0.2s;
  517.             text-decoration: none;
  518.             display: inline-flex;
  519.             align-items: center;
  520.             gap: 5px;
  521.         }
  522.         .shop-action-btn:hover {
  523.             background: #0056b3;
  524.             color: white;
  525.         }
  526.         .shop-action-btn.following {
  527.             background: #28a745;
  528.         }
  529.         .shop-action-btn.following:hover {
  530.             background: #1e7e34;
  531.         }
  532.         .shop-action-btn.secondary {
  533.             background: #6c757d;
  534.         }
  535.         .shop-action-btn.secondary:hover {
  536.             background: #545b62;
  537.         }
  538.         /* Onglets eBay-style avec classes Karma */
  539.         .shop-tabs {
  540.             background: white;
  541.             border: 1px solid #e1e1e1;
  542.             border-top: none;
  543.             border-radius: 0 0 4px 4px;
  544.             margin-top: 0;
  545.         }
  546.         .shop-tabs-nav {
  547.             display: flex;
  548.             border-bottom: 1px solid #e1e1e1;
  549.             margin: 0;
  550.             padding: 0;
  551.             list-style: none;
  552.             background: #f8f9fa;
  553.         }
  554.         .shop-tab {
  555.             margin: 0;
  556.         }
  557.         .shop-tab-link {
  558.             display: block;
  559.             padding: 12px 20px;
  560.             color: #000000;
  561.             text-decoration: none;
  562.             border-bottom: 2px solid transparent;
  563.             transition: all 0.2s;
  564.             font-weight: 500;
  565.             font-size: 1rem;
  566.         }
  567.         .shop-tab-link:hover,
  568.         .shop-tab-link.active {
  569.             color: #095ad3;
  570.             border-bottom-color: #095ad3;
  571.             background: #ffa200;
  572.         }
  573.         .shop-tab-content {
  574.             padding: 30px;
  575.             min-height: 400px;
  576.         }
  577.         .shop-tab-content:not(.active) {
  578.             display: none;
  579.         }
  580.         .shop-tab-content.active {
  581.             display: block;
  582.         }
  583.         /* Cards d'information avec style Karma */
  584.         .shop-info-card {
  585.             background: #f8f9fa;
  586.             border: 1px solid #e1e1e1;
  587.             border-radius: 4px;
  588.             padding: 20px;
  589.             margin-bottom: 20px;
  590.         }
  591.         .shop-info-card h6 {
  592.             color: #333;
  593.             font-weight: 600;
  594.             margin-bottom: 15px;
  595.             font-size: 1.1rem;
  596.         }
  597.         .shop-info-card p {
  598.             color: #666;
  599.             font-size: 0.9rem;
  600.             margin: 0;
  601.             line-height: 1.5;
  602.         }
  603.         .shop-contact-info {
  604.             display: flex;
  605.             flex-direction: column;
  606.             gap: 10px;
  607.         }
  608.         .shop-contact-item {
  609.             display: flex;
  610.             align-items: center;
  611.             gap: 10px;
  612.             font-size: 0.9rem;
  613.             color: #666;
  614.             padding: 5px 0;
  615.         }
  616.         .shop-contact-item i {
  617.             width: 16px;
  618.             color: #007bff;
  619.             text-align: center;
  620.         }
  621.         .shop-social-links {
  622.             display: flex;
  623.             gap: 10px;
  624.             margin-top: 15px;
  625.             flex-wrap: wrap;
  626.         }
  627.         .shop-social-link {
  628.             display: inline-flex;
  629.             align-items: center;
  630.             justify-content: center;
  631.             width: 36px;
  632.             height: 36px;
  633.             background: #f0f0f0;
  634.             color: #666;
  635.             border-radius: 4px;
  636.             text-decoration: none;
  637.             transition: all 0.2s;
  638.             font-size: 1.1rem;
  639.         }
  640.         .shop-social-link:hover {
  641.             background: #007bff;
  642.             color: white;
  643.             transform: translateY(-2px);
  644.         }
  645.         /* Produits avec style Karma */
  646.         .product-card {
  647.             background: white;
  648.             border: 1px solid #e1e1e1;
  649.             border-radius: 4px;
  650.             overflow: hidden;
  651.             transition: all 0.3s ease;
  652.             margin-bottom: 20px;
  653.         }
  654.         .product-card:hover {
  655.             transform: translateY(-2px);
  656.             box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  657.         }
  658.         /* Animation de tri des produits */
  659.         .product-item {
  660.             transition: all 0.3s ease;
  661.         }
  662.         .product-item.sorting {
  663.             opacity: 0;
  664.             transform: translateY(20px);
  665.         }
  666.         .product-item.sorted {
  667.             opacity: 1;
  668.             transform: translateY(0);
  669.         }
  670.         .product-image {
  671.             height: 200px;
  672.             background-size: cover;
  673.             background-position: center;
  674.             position: relative;
  675.             overflow: hidden;
  676.         }
  677.         .product-info {
  678.             padding: 15px;
  679.         }
  680.         .product-title {
  681.             font-size: 1rem;
  682.             font-weight: 600;
  683.             margin-bottom: 8px;
  684.             color: #333;
  685.             line-height: 1.3;
  686.         }
  687.         .product-title a {
  688.             color: #333;
  689.             text-decoration: none;
  690.         }
  691.         .product-title a:hover {
  692.             color: #007bff;
  693.         }
  694.         .product-price {
  695.             font-size: 1.2rem;
  696.             font-weight: bold;
  697.             color: #ff6b35;
  698.             margin-bottom: 10px;
  699.         }
  700.         .product-meta {
  701.             display: flex;
  702.             justify-content: space-between;
  703.             align-items: center;
  704.             font-size: 0.85rem;
  705.             color: #666;
  706.         }
  707.         .rating {
  708.             color: #ffc107;
  709.         }
  710.         /* Responsive avec classes Karma */
  711.         /* Responsive amélioré pour la page shop */
  712.         @media(max-width: 991.98px) {
  713.             .shop-carousel-ebay {
  714.                 margin: 0 10px;
  715.                 height: 300px;
  716.             }
  717.             
  718.             .shop-header-content {
  719.                 padding: 15px;
  720.                 margin: 0 10px 20px;
  721.             }
  722.             
  723.             .shop-header-content .row {
  724.                 flex-wrap: wrap;
  725.             }
  726.             
  727.             .shop-info-ebay {
  728.                 margin-top: 15px;
  729.             }
  730.         }
  731.         
  732.         @media(max-width: 768px) {
  733.             .shop-banner,
  734.             .shop-carousel-ebay {
  735.                 height: 250px;
  736.                 margin: 0;
  737.                 border-radius: 0;
  738.             }
  739.             
  740.             .shop-carousel-ebay .carousel-container {
  741.                 border-radius: 0;
  742.             }
  743.             .carousel-controls-ebay {
  744.                 padding: 0 10px;
  745.                 bottom: 15px;
  746.             }
  747.             .carousel-btn-ebay {
  748.                 width: 35px;
  749.                 height: 35px;
  750.                 font-size: 14px;
  751.             }
  752.             .carousel-indicators-ebay {
  753.                 bottom: 10px;
  754.                 gap: 6px;
  755.             }
  756.             
  757.             .carousel-indicator-ebay {
  758.                 width: 10px;
  759.                 height: 10px;
  760.             }
  761.             .shop-header-content {
  762.                 padding: 15px;
  763.                 margin: 0;
  764.             }
  765.             
  766.             .shop-header-content .container {
  767.                 padding-left: 15px;
  768.                 padding-right: 15px;
  769.             }
  770.             .shop-avatar {
  771.                 width: 60px;
  772.                 height: 60px;
  773.             }
  774.             .shop-title {
  775.                 font-size: 1.2rem;
  776.             }
  777.             .shop-actions-row {
  778.                 flex-direction: column;
  779.                 gap: 10px;
  780.             }
  781.             /* Styles eBay-style responsive */
  782.             .shop-header-content .row {
  783.                 flex-direction: column;
  784.                 text-align: center;
  785.             }
  786.             .shop-avatar-container-ebay {
  787.                 margin-right: 0;
  788.                 margin-bottom: 15px;
  789.                 align-self: center;
  790.             }
  791.             .shop-avatar-ebay {
  792.                 width: 80px;
  793.                 height: 80px;
  794.             }
  795.             .shop-name-ebay {
  796.                 font-size: 1.5rem;
  797.                 margin-right: 0;
  798.                 margin-bottom: 10px;
  799.             }
  800.             .stat-row {
  801.                 justify-content: center;
  802.                 gap: 15px;
  803.                 flex-wrap: wrap;
  804.             }
  805.             
  806.             .stat-item-ebay {
  807.                 font-size: 0.9rem;
  808.                 min-width: 100px;
  809.             }
  810.             .shop-additional-info {
  811.                 justify-content: center;
  812.                 flex-wrap: wrap;
  813.             }
  814.             .shop-actions-ebay {
  815.                 flex-direction: column;
  816.                 justify-content: center;
  817.                 min-width: auto;
  818.                 margin-top: 15px;
  819.                 width: 100%;
  820.             }
  821.             .btn-ebay {
  822.                 width: 100%;
  823.                 min-width: auto;
  824.                 margin-bottom: 10px;
  825.             }
  826.             .btn-shop,
  827.             .shop-action-btn {
  828.                 width: 100%;
  829.                 min-width: auto;
  830.                 height: 45px;
  831.                 font-size: 0.9rem;
  832.                 padding: 12px 20px;
  833.             }
  834.             .shop-tabs-nav {
  835.                 flex-wrap: wrap;
  836.                 justify-content: center;
  837.             }
  838.             
  839.             .shop-tab-link {
  840.                 font-size: 0.85rem;
  841.                 padding: 0.5rem 0.75rem;
  842.                 flex: 1;
  843.                 min-width: auto;
  844.             }
  845.             
  846.             /* Produits responsive */
  847.             #products-container .product-item {
  848.                 margin-bottom: 20px;
  849.             }
  850.             
  851.             .product-card {
  852.                 padding: 15px;
  853.             }
  854.             
  855.             .product-title {
  856.                 font-size: 0.95rem;
  857.             }
  858.             
  859.             .product-price {
  860.                 font-size: 1.1rem;
  861.             }
  862.             
  863.             /* Détails de la boutique responsive */
  864.             .shop-info-ebay {
  865.                 text-align: center;
  866.             }
  867.         }
  868.         
  869.         @media(max-width: 575.98px) {
  870.             .shop-banner,
  871.             .shop-carousel-ebay {
  872.                 height: 200px;
  873.                 margin: 0;
  874.             }
  875.             
  876.             .shop-header-content {
  877.                 margin: 0;
  878.                 padding: 15px;
  879.             }
  880.             
  881.             .shop-name-ebay {
  882.                 font-size: 1.3rem;
  883.             }
  884.             
  885.             .stat-row {
  886.                 gap: 10px;
  887.                 flex-direction: column;
  888.             }
  889.             
  890.             .stat-item-ebay {
  891.                 font-size: 0.85rem;
  892.                 width: 100%;
  893.             }
  894.             
  895.             .carousel-btn-ebay {
  896.                 width: 25px;
  897.                 height: 25px;
  898.                 font-size: 10px;
  899.             }
  900.             
  901.             .carousel-indicators-ebay {
  902.                 bottom: 8px;
  903.             }
  904.             
  905.             .carousel-indicator-ebay {
  906.                 width: 6px;
  907.                 height: 6px;
  908.             }
  909.             
  910.             .shop-tab-content {
  911.                 padding: 15px 10px;
  912.             }
  913.             .shop-stats-row {
  914.                 flex-direction: column;
  915.                 gap: 10px;
  916.                 align-items: flex-start;
  917.             }
  918.         }
  919.         .follow-button {
  920.             background: #ffa200;
  921.             border: none;
  922.             color: white;
  923.             padding: 12px 30px;
  924.             border-radius: 25px;
  925.             font-weight: 600;
  926.             transition: all 0.3s ease;
  927.             cursor: pointer;
  928.             display: inline-flex;
  929.             align-items: center;
  930.             gap: 8px;
  931.         }
  932.         .follow-button:hover {
  933.             background: #e8910a;
  934.             transform: translateY(-2px);
  935.             box-shadow: 0 5px 15px rgba(255, 162, 0, 0.3);
  936.         }
  937.         .follow-button.following {
  938.             background: #28a745;
  939.         }
  940.         .follow-button.following:hover {
  941.             background: #218838;
  942.         }
  943.         .follow-button:disabled {
  944.             opacity: 0.6;
  945.             cursor: not-allowed;
  946.             transform: none;
  947.         }
  948.         .follow-stats {
  949.             display: flex;
  950.             gap: 30px;
  951.             margin-top: 20px;
  952.             flex-wrap: wrap;
  953.         }
  954.         .follow-stat {
  955.             text-align: center;
  956.             padding: 15px;
  957.             background: #f8f9fa;
  958.             border-radius: 10px;
  959.             min-width: 120px;
  960.         }
  961.         .follow-stat-number {
  962.             font-size: 1.8rem;
  963.             font-weight: bold;
  964.             color: #ffa200;
  965.             display: block;
  966.         }
  967.         .follow-stat-label {
  968.             color: #666;
  969.             font-size: 0.9rem;
  970.             text-transform: uppercase;
  971.             letter-spacing: 0.5px;
  972.         }
  973.         .shop-actions {
  974.             display: flex;
  975.             gap: 15px;
  976.             align-items: center;
  977.             flex-wrap: wrap;
  978.             margin-top: 20px;
  979.         }
  980.         .action-button {
  981.             background: white;
  982.             border: 2px solid #ffa200;
  983.             color: #ffa200;
  984.             padding: 10px 20px;
  985.             border-radius: 20px;
  986.             text-decoration: none;
  987.             font-weight: 500;
  988.             transition: all 0.3s ease;
  989.             display: inline-flex;
  990.             align-items: center;
  991.             gap: 8px;
  992.         }
  993.         .action-button:hover {
  994.             background: #ffa200;
  995.             color: white;
  996.             transform: translateY(-2px);
  997.             box-shadow: 0 5px 15px rgba(255, 162, 0, 0.3);
  998.         }
  999.         .positive-feedback {
  1000.             color: #28a745;
  1001.             font-weight: bold;
  1002.         }
  1003.         .items-sold {
  1004.             color: #666;
  1005.             font-size: 0.9rem;
  1006.         }
  1007.         .followers-count {
  1008.             color: #666;
  1009.             font-size: 0.9rem;
  1010.         }
  1011.         .shop-avatar {
  1012.             width: 120px;
  1013.             height: 120px;
  1014.             border-radius: 50%;
  1015.             border: 4px solid white;
  1016.             object-fit: cover;
  1017.             margin-bottom: 20px;
  1018.         }
  1019.         .shop-stats {
  1020.             background: white;
  1021.             border-radius: 10px;
  1022.             padding: 30px;
  1023.             box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  1024.             margin-top: -50px;
  1025.             position: relative;
  1026.             z-index: 10;
  1027.         }
  1028.         .stat-item {
  1029.             text-align: center;
  1030.             padding: 20px;
  1031.         }
  1032.         .stat-number {
  1033.             font-size: 2.5rem;
  1034.             font-weight: bold;
  1035.             color: #ffa200;
  1036.             display: block;
  1037.         }
  1038.         .stat-label {
  1039.             color: #666;
  1040.             font-size: 0.9rem;
  1041.             text-transform: uppercase;
  1042.             letter-spacing: 1px;
  1043.         }
  1044.         .shop-description {
  1045.             background: #f8f9fa;
  1046.             padding: 30px;
  1047.             border-radius: 10px;
  1048.             margin-bottom: 40px;
  1049.         }
  1050.         .shop-contact {
  1051.             background: white;
  1052.             border: 1px solid #e9ecef;
  1053.             border-radius: 10px;
  1054.             padding: 25px;
  1055.             margin-bottom: 40px;
  1056.         }
  1057.         .contact-item {
  1058.             display: flex;
  1059.             align-items: center;
  1060.             margin-bottom: 15px;
  1061.         }
  1062.         .contact-item i {
  1063.             color: #ffa200;
  1064.             margin-right: 15px;
  1065.             width: 20px;
  1066.         }
  1067.         .product-card {
  1068.             background: white;
  1069.             border-radius: 10px;
  1070.             overflow: hidden;
  1071.             box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  1072.             transition: transform 0.3s ease, box-shadow 0.3s ease;
  1073.             margin-bottom: 30px;
  1074.         }
  1075.         .product-card:hover {
  1076.             transform: translateY(-5px);
  1077.             box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  1078.         }
  1079.         .product-image {
  1080.             height: 200px;
  1081.             background-size: cover;
  1082.             background-position: center;
  1083.             position: relative;
  1084.         }
  1085.         .product-info {
  1086.             padding: 20px;
  1087.         }
  1088.         .product-title {
  1089.             font-size: 1.1rem;
  1090.             font-weight: 600;
  1091.             margin-bottom: 10px;
  1092.             color: #333;
  1093.         }
  1094.         .product-price {
  1095.             font-size: 1.3rem;
  1096.             font-weight: bold;
  1097.             color: #ffa200;
  1098.             margin-bottom: 15px;
  1099.         }
  1100.         .product-meta {
  1101.             display: flex;
  1102.             justify-content: space-between;
  1103.             align-items: center;
  1104.             font-size: 0.9rem;
  1105.             color: #666;
  1106.         }
  1107.         .rating {
  1108.             color: #ffa200;
  1109.         }
  1110.         /* Boutons d'action uniformes */
  1111.         .btn-shop,
  1112.         .shop-action-btn {
  1113.             background: #ffa200;
  1114.             border: 1px solid #ffa200;
  1115.             color: white;
  1116.             padding: 12px 24px;
  1117.             border-radius: 6px;
  1118.             font-weight: 500;
  1119.             font-size: 0.9rem;
  1120.             transition: all 0.3s ease;
  1121.             text-decoration: none;
  1122.             display: inline-flex;
  1123.             align-items: center;
  1124.             justify-content: center;
  1125.             gap: 8px;
  1126.             min-width: 120px;
  1127.             height: 44px;
  1128.             white-space: nowrap;
  1129.         }
  1130.         .btn-shop:hover,
  1131.         .shop-action-btn:hover {
  1132.             background: #e8910a;
  1133.             border-color: #e8910a;
  1134.             color: white;
  1135.             transform: translateY(-1px);
  1136.             box-shadow: 0 4px 12px rgba(255, 162, 0, 0.3);
  1137.         }
  1138.         /* Boutons secondaires */
  1139.         .shop-action-btn.secondary {
  1140.             background: transparent;
  1141.             border: 1px solid #6c757d;
  1142.             color: #6c757d;
  1143.         }
  1144.         .shop-action-btn.secondary:hover {
  1145.             background: #6c757d;
  1146.             border-color: #6c757d;
  1147.             color: white;
  1148.             transform: translateY(-1px);
  1149.             box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
  1150.         }
  1151.         /* Responsive */
  1152.         @media(max-width: 768px) {
  1153.             .shop-header {
  1154.                 padding: 100px 0 40px;
  1155.             }
  1156.             .shop-avatar {
  1157.                 width: 80px;
  1158.                 height: 80px;
  1159.             }
  1160.             .shop-stats {
  1161.                 margin-top: -30px;
  1162.                 padding: 20px;
  1163.             }
  1164.             .stat-number {
  1165.                 font-size: 2rem;
  1166.             }
  1167.         }
  1168.         /* Très petits écrans */
  1169.         @media(max-width: 480px) {
  1170.             .btn-shop,
  1171.             .shop-action-btn {
  1172.                 min-width: 90px;
  1173.                 height: 38px;
  1174.                 font-size: 0.8rem;
  1175.                 padding: 8px 16px;
  1176.             }
  1177.             .shop-actions-row {
  1178.                 gap: 8px;
  1179.             }
  1180.         }
  1181.         /* Styles pour la section des avis */
  1182.         .review-stats-card {
  1183.             background: white;
  1184.             border-radius: 10px;
  1185.             padding: 20px;
  1186.             box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  1187.             margin-bottom: 20px;
  1188.         }
  1189.         .stats-header {
  1190.             display: flex;
  1191.             align-items: center;
  1192.             margin-bottom: 20px;
  1193.         }
  1194.         .overall-rating {
  1195.             text-align: center;
  1196.             margin-right: 20px;
  1197.         }
  1198.         .rating-number {
  1199.             font-size: 36px;
  1200.             font-weight: bold;
  1201.             color: #333;
  1202.             display: block;
  1203.         }
  1204.         .stars {
  1205.             color: #ffc107;
  1206.             font-size: 18px;
  1207.             margin-top: 5px;
  1208.         }
  1209.         .rating-summary p {
  1210.             margin: 0;
  1211.             color: #666;
  1212.         }
  1213.         .rating-breakdown {
  1214.             margin-top: 15px;
  1215.         }
  1216.         .rating-bar {
  1217.             display: flex;
  1218.             align-items: center;
  1219.             margin-bottom: 8px;
  1220.         }
  1221.         .rating-label {
  1222.             width: 40px;
  1223.             font-size: 14px;
  1224.             color: #666;
  1225.         }
  1226.         .rating-progress {
  1227.             flex: 1;
  1228.             height: 6px;
  1229.             background: #e9ecef;
  1230.             border-radius: 3px;
  1231.             margin: 0 10px;
  1232.             overflow: hidden;
  1233.         }
  1234.         .rating-fill {
  1235.             height: 100%;
  1236.             background: linear-gradient(45deg, #ffc107, #ff8c00);
  1237.             transition: width 0.3s ease;
  1238.         }
  1239.         .rating-count {
  1240.             width: 30px;
  1241.             text-align: right;
  1242.             font-size: 14px;
  1243.             color: #666;
  1244.         }
  1245.         .reviews-preview {
  1246.             background: white;
  1247.             border-radius: 10px;
  1248.             padding: 20px;
  1249.             box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  1250.         }
  1251.         .review-card-preview {
  1252.             border-bottom: 1px solid #f0f0f0;
  1253.             padding-bottom: 15px;
  1254.             margin-bottom: 15px;
  1255.         }
  1256.         .review-card-preview:last-child {
  1257.             border-bottom: none;
  1258.             margin-bottom: 0;
  1259.         }
  1260.         .review-header {
  1261.             display: flex;
  1262.             justify-content: space-between;
  1263.             align-items: center;
  1264.             margin-bottom: 10px;
  1265.         }
  1266.         .review-user {
  1267.             display: flex;
  1268.             align-items: center;
  1269.         }
  1270.         .user-avatar {
  1271.             width: 35px;
  1272.             height: 35px;
  1273.             border-radius: 50%;
  1274.             background: linear-gradient(45deg, #667eea, #764ba2);
  1275.             display: flex;
  1276.             align-items: center;
  1277.             justify-content: center;
  1278.             color: white;
  1279.             font-weight: bold;
  1280.             margin-right: 10px;
  1281.         }
  1282.         .user-info h6 {
  1283.             margin: 0;
  1284.             font-size: 14px;
  1285.             font-weight: 600;
  1286.             color: #333;
  1287.         }
  1288.         .user-info small {
  1289.             color: #666;
  1290.             font-size: 12px;
  1291.         }
  1292.         .review-rating {
  1293.             display: flex;
  1294.             align-items: center;
  1295.             gap: 5px;
  1296.         }
  1297.         .verified-badge {
  1298.             background: #28a745;
  1299.             color: white;
  1300.             padding: 2px 4px;
  1301.             border-radius: 3px;
  1302.             font-size: 10px;
  1303.             font-weight: bold;
  1304.         }
  1305.         .review-content {
  1306.             color: #666;
  1307.             font-size: 14px;
  1308.             line-height: 1.5;
  1309.         }
  1310.         .empty-reviews {
  1311.             text-align: center;
  1312.             padding: 40px 20px;
  1313.             color: #666;
  1314.         }
  1315.         .empty-reviews i {
  1316.             font-size: 48px;
  1317.             color: #ddd;
  1318.             margin-bottom: 15px;
  1319.         }
  1320.         .empty-reviews h4 {
  1321.             color: #333;
  1322.             margin-bottom: 10px;
  1323.         }
  1324.         .section-title h2 {
  1325.             color: #333;
  1326.             margin-bottom: 10px;
  1327.         }
  1328.         .section-title p {
  1329.             color: #666;
  1330.             margin-bottom: 30px;
  1331.         }
  1332.         @media(max-width: 768px) {
  1333.             .stats-header {
  1334.                 flex-direction: column;
  1335.                 text-align: center;
  1336.             }
  1337.             .overall-rating {
  1338.                 margin-right: 0;
  1339.                 margin-bottom: 15px;
  1340.             }
  1341.             .review-header {
  1342.                 flex-direction: column;
  1343.                 align-items: flex-start;
  1344.             }
  1345.             .review-rating {
  1346.                 margin-top: 5px;
  1347.             }
  1348.         }
  1349.     </style>
  1350. {% endblock %}
  1351. {% block body %}
  1352.     <!-- Shop Header eBay-style avec Karma - Pleine largeur -->
  1353.     <section
  1354.         class="shop-header">
  1355.         <!-- Carrousel eBay-style -->
  1356.         <div class="shop-carousel-ebay">
  1357.             <div class="carousel-container">
  1358.                 {% set allBannerImages = shop.getAllBannerImages() %}
  1359.                 {% if allBannerImages|length > 0 %}
  1360.                     {% for image in allBannerImages %}
  1361.                         <div class="carousel-slide {% if loop.first %}active{% endif %}" style="background-image: url('{{ asset(image) }}')">
  1362.                             <div class="shop-banner-overlay"></div>
  1363.                         </div>
  1364.                     {% endfor %}
  1365.                 {% else %}
  1366.                     <!-- Slide par défaut avec dégradé si aucune image de bannière -->
  1367.                     <div class="carousel-slide active" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);">
  1368.                         <div class="shop-banner-overlay"></div>
  1369.                     </div>
  1370.                 {% endif %}
  1371.             </div>
  1372.             <!-- Contrôles eBay-style intégrés - uniquement si plusieurs images de bannière -->
  1373.             {% set totalBannerImages = allBannerImages|length %}
  1374.             {% if totalBannerImages > 1 %}
  1375.                 <div class="carousel-controls-ebay">
  1376.                     <button class="carousel-btn-ebay prev-btn" onclick="previousSlide()" id="prevBtn">
  1377.                         <i class="lnr lnr-chevron-left"></i>
  1378.                     </button>
  1379.                     <button class="carousel-btn-ebay pause-btn" onclick="toggleCarousel()" id="pauseBtn">
  1380.                         <i class="lnr lnr-pause" id="pauseIcon"></i>
  1381.                     </button>
  1382.                     <button class="carousel-btn-ebay next-btn" onclick="nextSlide()" id="nextBtn">
  1383.                         <i class="lnr lnr-chevron-right"></i>
  1384.                     </button>
  1385.                 </div>
  1386.                 <!-- Indicateurs eBay-style - uniquement pour les images de bannière -->
  1387.                 <div class="carousel-indicators-ebay">
  1388.                     {% for image in allBannerImages %}
  1389.                         <button class="carousel-indicator-ebay {% if loop.first %}active{% endif %}" onclick="goToSlide({{ loop.index0 }})"></button>
  1390.                     {% endfor %}
  1391.                 </div>
  1392.             {% endif %}
  1393.         </div>
  1394.         <!-- Contenu de la boutique eBay-style -->
  1395.         <div class="shop-header-content">
  1396.             <div
  1397.                 class="row align-items-center">
  1398.                 <!-- Logo de la boutique -->
  1399.                 <div class="col-auto">
  1400.                     <div class="shop-avatar-container-ebay">
  1401.                         {% if shop.logo %}
  1402.                             <img src="{{ asset(shop.logo) }}" alt="{{ shop.name }}" class="shop-avatar-ebay">
  1403.                         {% else %}
  1404.                             <div class="shop-avatar-ebay" style="background: #f0f0f0; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #666;">
  1405.                                 <i class="lnr lnr-store"></i>
  1406.                             </div>
  1407.                         {% endif %}
  1408.                         {% if shop.isVerified %}
  1409.                             <div class="verified-badge-ebay">
  1410.                                 <i class="lnr lnr-checkmark-circle"></i>
  1411.                             </div>
  1412.                         {% endif %}
  1413.                     </div>
  1414.                 </div>
  1415.                 <!-- Informations principales -->
  1416.                 <div class="col">
  1417.                     <div
  1418.                         class="shop-info-ebay">
  1419.                         <!-- Nom de la boutique -->
  1420.                         <div class="shop-name-section">
  1421.                             <h1 class="shop-name-ebay">{{ shop.name }}</h1>
  1422.                             {% if shop.isVerified %}
  1423.                                 <span class="verified-text">
  1424.                                     <i class="lnr lnr-checkmark-circle me-1"></i>Vendeur vérifié
  1425.                                 </span>
  1426.                             {% endif %}
  1427.                         </div>
  1428.                         <!-- Catégorie -->
  1429.                         {% if shop.shopCategory %}
  1430.                             <div class="shop-category-section">
  1431.                                 <span class="shop-category-ebay">{{ shop.shopCategory.name }}</span>
  1432.                             </div>
  1433.                         {% endif %}
  1434.                         <!-- Statistiques eBay-style -->
  1435.                         <div class="shop-stats-ebay">
  1436.                             <div class="stat-row">
  1437.                                 {% if shop.averageRating > 0 %}
  1438.                                     <div class="stat-item-ebay">
  1439.                                         <span class="stat-percentage">{{ shop.averageRating|number_format(1) }}%</span>
  1440.                                         <span class="stat-label-ebay">Évaluations positives</span>
  1441.                                     </div>
  1442.                                 {% endif %}
  1443.                                 {% if stats.totalProductSales > 0 %}
  1444.                                     <div class="stat-item-ebay">
  1445.                                         <span class="stat-number-ebay">{{ stats.totalProductSales|number_format }}</span>
  1446.                                         <span class="stat-label-ebay">Articles vendus</span>
  1447.                                     </div>
  1448.                                 {% endif %}
  1449.                                 {% if followStats.active_follows > 0 %}
  1450.                                     <div class="stat-item-ebay">
  1451.                                         <span class="stat-number-ebay">{{ followStats.active_follows|number_format }}</span>
  1452.                                         <span class="stat-label-ebay">Suiveurs</span>
  1453.                                     </div>
  1454.                                 {% endif %}
  1455.                             </div>
  1456.                             <!-- Informations supplémentaires -->
  1457.                             <div class="shop-additional-info">
  1458.                                 <div class="row">
  1459.                                     <div class="col-12">
  1460.                                         <span class="member-since col-md-3 col-sm-6 w-100">
  1461.                                             <i class="lnr lnr-thumbs-up"></i>
  1462.                                             7% positive feedback</span>
  1463.                                         <span class="member-since col-md-3 col-sm-6 w-100">
  1464.                                             <i class="lnr lnr-cart"></i>
  1465.                                             29 produits vendus</span>
  1466.                                         <span class="member-since col-md-3 col-sm-6 w-100">
  1467.                                             <i class="lnr lnr-star"></i>
  1468.                                             150 followers</span>
  1469.                                         <span class="member-since col-md-3 w-100">
  1470.                                             <i class="lnr lnr-history"></i>
  1471.                                             Créé depuis
  1472.                                             {{ shop.createdAt|date('M Y') }}</span>
  1473.                                     </div>
  1474.                                 </div>
  1475.                             </div>
  1476.                         </div>
  1477.                     </div>
  1478.                 </div>
  1479.                 <!-- Actions eBay-style -->
  1480.                 <div class="col-auto">
  1481.                     <div class="shop-actions-ebay">
  1482.                         {% if app.user %}
  1483.                             <button id="follow-button" class="btn btn-primary btn-ebay {% if isFollowing %}following{% endif %}" data-shop-id="{{ shop.id }}" data-following="{{ isFollowing ? 'true' : 'false' }}">
  1484.                                 <span id="follow-text">
  1485.                                     {% if isFollowing %}
  1486.                                         <i class="lnr lnr-checkmark-circle me-1"></i> Suivi
  1487.                                     {% else %}
  1488.                                         <i class="lnr lnr-plus me-1"></i> Suivre
  1489.                                     {% endif %}
  1490.                                 </span>
  1491.                             </button>
  1492.                         {% else %}
  1493.                             <a href="{{ path('ui_app_login') }}" class="btn btn-primary btn-ebay">
  1494.                                 <i class="lnr lnr-user me-1"></i> Se connecter pour suivre
  1495.                             </a>
  1496.                         {% endif %}
  1497.                         <button class="btn btn-outline-secondary btn-ebay" onclick="shareShop()">
  1498.                             <i class="lnr lnr-bubble me-1"></i> Partager
  1499.                         </button>
  1500.                         <button class="btn btn-outline-danger btn-ebay" onclick="reportShop()">
  1501.                             <i class="lnr lnr-flag me-1"></i> Signaler
  1502.                         </button>
  1503.                         {% if canEdit %}
  1504.                             <a href="{{ path('seller_shop_edit', {slug: shop.slug}) }}" class="btn btn-outline-primary btn-ebay">
  1505.                                 <i class="lnr lnr-pencil me-1"></i> Modifier la boutique
  1506.                             </a>
  1507.                         {% endif %}
  1508.                     </div>
  1509.                 </div>
  1510.             </div>
  1511.         </div>
  1512.     </section>
  1513.     <!-- Shop Tabs eBay-style avec Karma -->
  1514.     <section class="container">
  1515.         <div class="shop-tabs">
  1516.             <ul class="nav nav-tabs shop-tabs-nav" role="tablist">
  1517.                 <li class="nav-item shop-tab">
  1518.                     <a href="#shop-items" class="nav-link shop-tab-link active" data-tab="items" role="tab">
  1519.                         Boutique
  1520.                     </a>
  1521.                 </li>
  1522.                 <li class="nav-item shop-tab">
  1523.                     <a href="#shop-sale" class="nav-link shop-tab-link" data-tab="sale" role="tab">
  1524.                         Promotions
  1525.                     </a>
  1526.                 </li>
  1527.                 <li class="nav-item shop-tab">
  1528.                     <a href="#shop-about" class="nav-link shop-tab-link" data-tab="about" role="tab">
  1529.                         À propos
  1530.                     </a>
  1531.                 </li>
  1532.                 <li class="nav-item shop-tab">
  1533.                     <a href="#shop-feedback" class="nav-link shop-tab-link" data-tab="feedback" role="tab">
  1534.                         Avis ({{ shop.getVisibleReviewsCount() }})
  1535.                     </a>
  1536.                 </li>
  1537.             </ul>
  1538.             <!-- Tab Content: Shop Items avec Karma -->
  1539.             <div id="shop-items" class="tab-content shop-tab-content active">
  1540.                 <div class="row">
  1541.                     <div class="col-lg-12">
  1542.                         <div class="d-flex justify-content-between align-items-center mb-4">
  1543.                             <h4 class="mb-0">Produits de
  1544.                                 {{ shop.name }}</h4>
  1545.                             <div class="d-flex align-items-center gap-3">
  1546.                                 <span style="font-size: 2rem; font-weight: 600; min-width: 100px; display: inline-block; text-align: center;">
  1547.                                     <span class="product-count">{{ products|length|number_format }}</span>
  1548.                                     <span style="font-size: 1rem; font-weight: 400;">produits</span>
  1549.                                 </span>
  1550.                                 <select class="form-select" id="product-sort" style="width: auto;" onchange="if(window.sortProducts) window.sortProducts(this.value);">
  1551.                                     <option value="">Trier par</option>
  1552.                                     <option value="price_asc">Prix : Croissant</option>
  1553.                                     <option value="price_desc">Prix : Décroissant</option>
  1554.                                     <option value="newest">Plus récents</option>
  1555.                                     <option value="popular">Plus populaires</option>
  1556.                                     <option value="name_asc">Nom : A-Z</option>
  1557.                                     <option value="name_desc">Nom : Z-A</option>
  1558.                                 </select>
  1559.                             </div>
  1560.                         </div>
  1561.                         {% if products|length > 0 %}
  1562.                             <div class="row" id="products-container">
  1563.                                 {% for product in products %}
  1564.                                     <div class="col-xl-3 col-lg-4 col-md-6 col-sm-6 mb-4 d-flex align-items-stretch product-item" data-price="{{ product.price }}" data-name="{{ product.name|lower }}" data-views="{{ product.viewCount ?? 0 }}" data-created="{{ product.publishedAt|date('Y-m-d') }}">
  1565.                                         {% include 'home/_single_product_card.html.twig' with {'product': product} %}
  1566.                                     </div>
  1567.                                 {% endfor %}
  1568.                             </div>
  1569.                         {% else %}
  1570.                             <div class="text-center py-5">
  1571.                                 <i class="lnr lnr-package" style="font-size: 4rem; color: #ccc;"></i>
  1572.                                 <h4 class="mt-3">Aucun produit disponible</h4>
  1573.                                 <p class="text-muted">Cette boutique n'a pas encore de produits en vente.</p>
  1574.                             </div>
  1575.                         {% endif %}
  1576.                     </div>
  1577.                 </div>
  1578.             </div>
  1579.             <!-- Tab Content: Sale avec Karma -->
  1580.             <div id="shop-sale" class="tab-content shop-tab-content">
  1581.                 <div class="text-center py-5">
  1582.                     <i class="lnr lnr-tag" style="font-size: 4rem; color: #ccc;"></i>
  1583.                     <h4 class="mt-3">Aucune promotion actuellement</h4>
  1584.                     <p class="text-muted">Cette boutique n'a pas de promotions actives pour le moment.</p>
  1585.                 </div>
  1586.             </div>
  1587.             <!-- Tab Content: About avec Karma -->
  1588.             <div id="shop-about" class="tab-content shop-tab-content">
  1589.                 <div class="row">
  1590.                     <div class="col-lg-8">
  1591.                         <div class="card">
  1592.                             <div class="card-header">
  1593.                                 <h5 class="mb-0">
  1594.                                     <i class="lnr lnr-user me-2"></i>À propos de
  1595.                                     {{ shop.name }}
  1596.                                 </h5>
  1597.                             </div>
  1598.                             <div class="card-body">
  1599.                                 {% if shop.description %}
  1600.                                     <p class="card-text">{{ shop.description }}</p>
  1601.                                 {% else %}
  1602.                                     <p class="text-muted">Aucune description disponible.</p>
  1603.                                 {% endif %}
  1604.                                 {% if shop.businessHours %}
  1605.                                     <h6 class="mt-4">
  1606.                                         <i class="lnr lnr-clock me-2"></i>Heures d'ouverture
  1607.                                     </h6>
  1608.                                     <p>{{ shop.businessHours }}</p>
  1609.                                 {% endif %}
  1610.                                 {% if shop.returnPolicy %}
  1611.                                     <h6 class="mt-4">
  1612.                                         <i class="lnr lnr-undo me-2"></i>Politique de retour
  1613.                                     </h6>
  1614.                                     <p>{{ shop.returnPolicy }}</p>
  1615.                                 {% endif %}
  1616.                             </div>
  1617.                         </div>
  1618.                     </div>
  1619.                     <div class="col-lg-4">
  1620.                         <div class="card shop-info-card">
  1621.                             <div class="card-header">
  1622.                                 <h6 class="mb-0">
  1623.                                     <i class="lnr lnr-chart me-2"></i>Statistiques de la boutique
  1624.                                 </h6>
  1625.                             </div>
  1626.                             <div class="card-body">
  1627.                                 <div class="row text-center">
  1628.                                     <div class="col-6">
  1629.                                         <div class="shop-stat-item">
  1630.                                             <span class="stat-number h4 text-primary">{{ stats.activeProducts }}</span>
  1631.                                             <span class="stat-label d-block">Produits actifs</span>
  1632.                                         </div>
  1633.                                     </div>
  1634.                                     <div class="col-6">
  1635.                                         <div class="shop-stat-item">
  1636.                                             <span class="stat-number h4 text-info">{{ stats.shopViews }}</span>
  1637.                                             <span class="stat-label d-block">Vues boutique</span>
  1638.                                         </div>
  1639.                                     </div>
  1640.                                 </div>
  1641.                             </div>
  1642.                         </div>
  1643.                     </div>
  1644.                 </div>
  1645.             </div>
  1646.             <!-- Tab Content: Feedback avec Karma -->
  1647.             <div id="shop-feedback" class="tab-content shop-tab-content">
  1648.                 <div class="row">
  1649.                     <div
  1650.                         class="col-lg-8">
  1651.                         <!-- Statistiques des avis -->
  1652.                         <div class="review-stats mb-4">
  1653.                             <div class="row">
  1654.                                 <div class="col-md-4">
  1655.                                     <div class="stat-card text-center">
  1656.                                         <h3 class="stat-number">{{ shop.getAverageRating() }}</h3>
  1657.                                         <div class="rating-stars">
  1658.                                             {% for i in 1..5 %}
  1659.                                                 <i class="lnr lnr-star{% if i <= shop.getAverageRating() %}{% else %}-empty{% endif %}"></i>
  1660.                                             {% endfor %}
  1661.                                         </div>
  1662.                                         <p class="stat-label">Note moyenne</p>
  1663.                                     </div>
  1664.                                 </div>
  1665.                                 <div class="col-md-4">
  1666.                                     <div class="stat-card text-center">
  1667.                                         <h3 class="stat-number">{{ shop.getVisibleReviewsCount() }}</h3>
  1668.                                         <p class="stat-label">Avis clients</p>
  1669.                                     </div>
  1670.                                 </div>
  1671.                                 <div class="col-md-4">
  1672.                                     <div class="stat-card text-center">
  1673.                                         <h3 class="stat-number">{{ ((shop.getVisibleReviewsCount() / 100) * 100)|round }}%</h3>
  1674.                                         <p class="stat-label">Satisfaction</p>
  1675.                                     </div>
  1676.                                 </div>
  1677.                             </div>
  1678.                         </div>
  1679.                         <!-- Liste des avis récents -->
  1680.                         <div class="reviews-preview">
  1681.                             <h5 class="mb-3">Avis récents</h5>
  1682.                             {% if shop.reviews|length > 0 %}
  1683.                                 <div class="reviews-list">
  1684.                                     {% for review in shop.reviews|slice(0, 5) %}
  1685.                                         {% if review.isVisible %}
  1686.                                             <div class="review-item">
  1687.                                                 <div class="review-header">
  1688.                                                     <div class="reviewer-info">
  1689.                                                         <div class="reviewer-avatar">
  1690.                                                             <i class="lnr lnr-user"></i>
  1691.                                                         </div>
  1692.                                                         <div class="reviewer-details">
  1693.                                                             <h6 class="reviewer-name">{{ review.user.userIdentifier }}</h6>
  1694.                                                             <div class="review-rating">
  1695.                                                                 {% for i in 1..5 %}
  1696.                                                                     <i class="lnr lnr-star{% if i <= review.rating %}{% else %}-empty{% endif %}"></i>
  1697.                                                                 {% endfor %}
  1698.                                                             </div>
  1699.                                                         </div>
  1700.                                                     </div>
  1701.                                                     <div class="review-meta">
  1702.                                                         <span class="review-date">{{ review.createdAt|date('d/m/Y') }}</span>
  1703.                                                         {% if review.isVerified %}
  1704.                                                             <span class="verified-badge">
  1705.                                                                 <i class="lnr lnr-checkmark-circle"></i>
  1706.                                                                 Vérifié
  1707.                                                             </span>
  1708.                                                         {% endif %}
  1709.                                                     </div>
  1710.                                                 </div>
  1711.                                                 {% if review.comment %}
  1712.                                                     <div class="review-comment">
  1713.                                                         <p>{{ review.comment|length > 150 ? review.comment|slice(0, 150) ~ '...' : review.comment }}</p>
  1714.                                                     </div>
  1715.                                                 {% endif %}
  1716.                                             </div>
  1717.                                         {% endif %}
  1718.                                     {% endfor %}
  1719.                                 </div>
  1720.                                 <div class="text-center mt-4">
  1721.                                     <a href="{{ path('shop_reviews_index', {'slug': shop.slug}) }}" class="btn btn-primary">
  1722.                                         <i class="lnr lnr-star me-1"></i>Voir tous les avis
  1723.                                     </a>
  1724.                                 </div>
  1725.                             {% else %}
  1726.                                 <div class="text-center py-4">
  1727.                                     <i class="lnr lnr-star" style="font-size: 3rem; color: #ccc;"></i>
  1728.                                     <h5 class="mt-3">Aucun avis pour le moment</h5>
  1729.                                     <p class="text-muted">Cette boutique n'a pas encore reçu d'avis clients.</p>
  1730.                                 </div>
  1731.                             {% endif %}
  1732.                         </div>
  1733.                     </div>
  1734.                     <div
  1735.                         class="col-lg-4">
  1736.                         <!-- Lien vers la page complète des avis -->
  1737.                         <div class="review-actions-card">
  1738.                             <h5>Évaluer cette boutique</h5>
  1739.                             <p class="text-muted">Partagez votre expérience avec cette boutique.</p>
  1740.                             <a href="{{ path('shop_reviews_new', {'slug': shop.slug}) }}" class="btn btn-primary w-100">
  1741.                                 <i class="lnr lnr-star me-1"></i>Laisser un avis
  1742.                             </a>
  1743.                         </div>
  1744.                     </div>
  1745.                 </div>
  1746.             </div>
  1747.         </div>
  1748.     </section>
  1749.     <!-- Modal de signalement -->
  1750.     <div class="modal fade" id="reportModal" tabindex="-1" aria-labelledby="reportModalLabel" aria-hidden="true">
  1751.         <div class="modal-dialog">
  1752.             <div class="modal-content">
  1753.                 <div class="modal-header">
  1754.                     <h5 class="modal-title" id="reportModalLabel">
  1755.                         <i class="lnr lnr-flag me-2"></i>&nbsp;Signaler cette boutique
  1756.                     </h5>
  1757.                     <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1758.                 </div>
  1759.                 <div class="modal-body">
  1760.                     <form id="reportForm">
  1761.                         <div class="mb-3">
  1762.                             <label for="reportReason" class="form-label">Motif du signalement *</label>
  1763.                             <select class="form-select" id="reportReason" required>
  1764.                                 <option value="">Sélectionnez un motif</option>
  1765.                                 <option value="fake_products">Produits contrefaits</option>
  1766.                                 <option value="inappropriate_content">Contenu inapproprié</option>
  1767.                                 <option value="spam">Spam ou publicité abusive</option>
  1768.                                 <option value="fraud">Fraude ou escroquerie</option>
  1769.                                 <option value="harassment">Harcèlement</option>
  1770.                                 <option value="other">Autre</option>
  1771.                             </select>
  1772.                         </div>
  1773.                         <div class="mb-3">
  1774.                             <label for="reportDescription" class="form-label">Description détaillée *</label>
  1775.                             <textarea class="form-control" id="reportDescription" rows="4" placeholder="Décrivez le problème rencontré..." required></textarea>
  1776.                         </div>
  1777.                         <div class="mb-3">
  1778.                             <label for="reportEmail" class="form-label">Votre email (optionnel)</label>
  1779.                             <input type="email" class="form-control" id="reportEmail" placeholder="votre@email.com">
  1780.                             <div class="form-text">Nous pourrons vous contacter pour plus d'informations</div>
  1781.                         </div>
  1782.                     </form>
  1783.                 </div>
  1784.                 <div class="modal-footer">
  1785.                     <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
  1786.                     <button type="button" class="btn btn-danger" onclick="submitReport()">
  1787.                         <i class="lnr lnr-flag  me-2"></i>Envoyer le signalement
  1788.                     </button>
  1789.                 </div>
  1790.             </div>
  1791.         </div>
  1792.     </div>
  1793.     <!-- Section des avis -->
  1794.     <div class="container my-5">
  1795.         <div class="row">
  1796.             <div class="col-12">
  1797.                 <div class="section-title text-center">
  1798.                     <h2>Avis clients</h2>
  1799.                     <p>Découvrez ce que pensent nos clients de cette boutique</p>
  1800.                 </div>
  1801.             </div>
  1802.         </div>
  1803.         <div
  1804.             class="row">
  1805.             <!-- Statistiques des avis -->
  1806.             <div class="col-md-4">
  1807.                 <div class="review-stats-card">
  1808.                     <div class="stats-header">
  1809.                         <div class="overall-rating">
  1810.                             <span class="rating-number">{{ shop.reviews|length > 0 ? (shop.reviews|map(r => r.rating)|reduce((a, b) => a + b) / shop.reviews|length)|number_format(1) : '0.0' }}</span>
  1811.                             <div class="stars">
  1812.                                 {% set avgRating = shop.reviews|length > 0 ? (shop.reviews|map(r => r.rating)|reduce((a, b) => a + b) / shop.reviews|length) : 0 %}
  1813.                                 {% for i in 1..5 %}
  1814.                                     {% if i <= avgRating %}
  1815.                                         ★
  1816.                                     {% elseif i - avgRating < 1 %}
  1817.                                         ☆
  1818.                                     {% else %}
  1819.                                         ☆
  1820.                                     {% endif %}
  1821.                                 {% endfor %}
  1822.                             </div>
  1823.                         </div>
  1824.                         <div class="rating-summary">
  1825.                             <p class="mb-1">{{ shop.reviews|length }}
  1826.                                 avis</p>
  1827.                             <p class="text-muted small">Basé sur
  1828.                                 {{ shop.reviews|filter(r => r.isVerified)|length }}
  1829.                                 avis vérifiés</p>
  1830.                         </div>
  1831.                     </div>
  1832.                     <div class="rating-breakdown">
  1833.                         {% for rating in 5..1 %}
  1834.                             {% set count = shop.reviews|filter(r => r.rating == rating)|length %}
  1835.                             {% set percentage = shop.reviews|length > 0 ? (count / shop.reviews|length * 100) : 0 %}
  1836.                             <div class="rating-bar">
  1837.                                 <span class="rating-label">{{ rating }}★</span>
  1838.                                 <div class="rating-progress">
  1839.                                     <div class="rating-fill" style="width: {{ percentage }}%"></div>
  1840.                                 </div>
  1841.                                 <span class="rating-count">{{ count }}</span>
  1842.                             </div>
  1843.                         {% endfor %}
  1844.                     </div>
  1845.                 </div>
  1846.             </div>
  1847.             <!-- Aperçu des avis -->
  1848.             <div class="col-md-8">
  1849.                 <div class="reviews-preview">
  1850.                     {% if shop.reviews|length > 0 %}
  1851.                         {% for review in shop.reviews|slice(0, 3) %}
  1852.                             <div class="review-card-preview">
  1853.                                 <div class="review-header">
  1854.                                     <div class="review-user">
  1855.                                         <div class="user-avatar">
  1856.                                             {{ review.user.firstName|first|upper|default(review.user.email|first|upper) }}
  1857.                                         </div>
  1858.                                         <div class="user-info">
  1859.                                             <h6>{{ review.user.firstName|default('Utilisateur') }}</h6>
  1860.                                             <small>{{ review.getTimeAgo() }}</small>
  1861.                                         </div>
  1862.                                     </div>
  1863.                                     <div class="review-rating">
  1864.                                         <div class="stars">{{ review.getRatingStars() }}</div>
  1865.                                         {% if review.isVerified %}
  1866.                                             <span class="verified-badge">✓</span>
  1867.                                         {% endif %}
  1868.                                     </div>
  1869.                                 </div>
  1870.                                 <div class="review-content">
  1871.                                     {{ review.comment|slice(0, 150) }}
  1872.                                     {% if review.comment|length > 150 %}...
  1873.                                     {% endif %}
  1874.                                 </div>
  1875.                             </div>
  1876.                         {% endfor %}
  1877.                         <div class="text-center mt-3">
  1878.                             <a href="{{ path('shop_reviews_index', {'slug': shop.slug}) }}" class="btn btn-outline-primary">
  1879.                                 Voir tous les avis ({{ shop.reviews|length }})
  1880.                             </a>
  1881.                         </div>
  1882.                     {% else %}
  1883.                         <div class="empty-reviews">
  1884.                             <i class="lnr lnr-star"></i>
  1885.                             <h4>Aucun avis pour le moment</h4>
  1886.                             <p>Soyez le premier à laisser un avis sur cette boutique !</p>
  1887.                             {% if app.user %}
  1888.                                 <a href="{{ path('shop_reviews_new', {'slug': shop.slug}) }}" class="btn btn-primary">
  1889.                                     <i class="lnr lnraccount_recently_viewed-star"></i>
  1890.                                     Laisser un avis
  1891.                                 </a>
  1892.                             {% endif %}
  1893.                         </div>
  1894.                     {% endif %}
  1895.                 </div>
  1896.             </div>
  1897.         </div>
  1898.     </div>
  1899. {% endblock %}
  1900. {% block javascripts %}
  1901.     <script>
  1902.         document.addEventListener('DOMContentLoaded', function () { // Initialisation du carrousel
  1903. initCarousel();
  1904. // Gestion des onglets eBay-style avec Bootstrap
  1905. const tabLinks = document.querySelectorAll('.shop-tab-link');
  1906. const tabContents = document.querySelectorAll('.shop-tab-content');
  1907. tabLinks.forEach(link => {
  1908. link.addEventListener('click', function (e) {
  1909. e.preventDefault();
  1910. // Retirer la classe active de tous les liens et contenus
  1911. tabLinks.forEach(l => {
  1912. l.classList.remove('active');
  1913. l.setAttribute('aria-selected', 'false');
  1914. });
  1915. tabContents.forEach(c => c.classList.remove('active'));
  1916. // Ajouter la classe active au lien cliqué
  1917. this.classList.add('active');
  1918. this.setAttribute('aria-selected', 'true');
  1919. // Afficher le contenu correspondant
  1920. const targetTab = this.dataset.tab;
  1921. const targetContent = document.getElementById (`shop-${targetTab}`);
  1922. if (targetContent) {
  1923. targetContent.classList.add('active');
  1924. }
  1925. });
  1926. });
  1927. // Gestion du système de follow
  1928. const followButton = document.getElementById('follow-button');
  1929. if (followButton) {
  1930. followButton.addEventListener('click', function () {
  1931. const shopId = this.dataset.shopId;
  1932. const isFollowing = this.dataset.following === 'true';
  1933. // Désactiver le bouton pendant la requête
  1934. this.disabled = true;
  1935. const originalText = this.innerHTML;
  1936. this.innerHTML = '<i class="lnr lnr-spinner"></i> Loading...';
  1937. // Envoyer la requête
  1938. fetch("{{ path('ui_api_shop_toggle_follow', {id: '__SHOP_ID__'}) }}".replace('__SHOP_ID__', shopId), {
  1939. method: 'POST',
  1940. headers: {
  1941. 'Content-Type': 'application/json',
  1942. 'X-Requested-With': 'XMLHttpRequest'
  1943. }
  1944. }).then(response => response.json()).then(data => {
  1945. if (data.success) { // Mettre à jour l'interface
  1946. this.dataset.following = data.isFollowing;
  1947. if (data.isFollowing) {
  1948. this.classList.add('following');
  1949. this.innerHTML = '<i class="lnr lnr-checkmark"></i> Suivi';
  1950. } else {
  1951. this.classList.remove('following');
  1952. this.innerHTML = '<i class="lnr lnr-plus"></i> Suivre';
  1953. }
  1954. // Mettre à jour le compteur de followers
  1955. if (followersCount && data.followersCount !== undefined) {
  1956. followersCount.textContent = data.followersCount.toLocaleString();
  1957. }
  1958. // Afficher un message de confirmation
  1959. showNotification(data.message, 'success');
  1960. } else {
  1961. showNotification(data.message, 'error');
  1962. }
  1963. }).catch(error => {
  1964. console.error('Erreur:', error);
  1965. showNotification('Une erreur est survenue', 'error');
  1966. }). finally(() => {
  1967. this.disabled = false;
  1968. });
  1969. });
  1970. }
  1971. // Fonction pour afficher les notifications
  1972. function showNotification(message, type = 'info') { // Créer l'élément de notification
  1973. const notification = document.createElement('div');
  1974. notification.className = `alert alert-${
  1975. type === 'success' ? 'success' : type === 'error' ? 'danger' : 'info'
  1976. } alert-dismissible fade show position-fixed`;
  1977. notification.style.cssText = 'top: 20px; right: 20px; z-index: 9999; min-width: 300px;';
  1978. notification.innerHTML = `
  1979.             ${message}
  1980.             <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
  1981.         `;
  1982. document.body.appendChild(notification);
  1983. // Supprimer automatiquement après 5 secondes
  1984. setTimeout(() => {
  1985. if (notification.parentNode) {
  1986. notification.remove();
  1987. }
  1988. }, 5000);
  1989. }
  1990. // Fonctions pour les actions de boutique
  1991. window.shareShop = function () { // Vérifier si l'API Web Share est disponible et si on est sur mobile
  1992. if (navigator.share && /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
  1993. navigator.share({title: '{{ shop.name }}- Boutique sur MaketOu', text: 'Découvrez cette boutique et ses produits sur MaketOu', url: window.location.href}).then(() => {
  1994. console.log('Partage réussi');
  1995. showNotification('Lien partagé avec succès !', 'success');
  1996. }).catch((error) => {
  1997. console.log('Erreur lors du partage:', error);
  1998. // Fallback vers la copie
  1999. copyToClipboard();
  2000. });
  2001. } else { // Sur desktop ou si Web Share n'est pas disponible, copier directement
  2002. copyToClipboard();
  2003. }
  2004. };
  2005. // Fonction pour copier le lien dans le presse-papiers
  2006. function copyToClipboard() {
  2007. const shopUrl = window.location.href;
  2008. const shopName = '{{ shop.name }}';
  2009. const shareText = `Découvrez la boutique "${shopName}" sur MaketOu : ${shopUrl}`;
  2010. // Utiliser directement le fallback pour éviter les conflits
  2011. fallbackCopyToClipboard(shareText);
  2012. }
  2013. // Fallback pour copier le texte
  2014. function fallbackCopyToClipboard(text) {
  2015. const textArea = document.createElement('textarea');
  2016. textArea.value = text;
  2017. textArea.style.position = 'fixed';
  2018. textArea.style.left = '-999999px';
  2019. textArea.style.top = '-999999px';
  2020. document.body.appendChild(textArea);
  2021. textArea.focus();
  2022. textArea.select();
  2023. try {
  2024. document.execCommand('copy');
  2025. showNotification('Lien copié dans le presse-papiers !', 'success');
  2026. } catch (err) {
  2027. console.error('Impossible de copier:', err);
  2028. showNotification('Impossible de copier le lien', 'error');
  2029. }
  2030. document.body.removeChild(textArea);
  2031. }
  2032. window.contactShop = function () { // Ouvrir un modal de signalement
  2033. openReportModal();
  2034. };
  2035. window.saveShop = function () { // Sauvegarder la boutique dans les favoris
  2036. showNotification('Boutique sauvegardée dans vos favoris', 'success');
  2037. };
  2038. // Fonction pour ouvrir le modal de signalement
  2039. window.openReportModal = function () {
  2040. const modal = new bootstrap.Modal(document.getElementById('reportModal'));
  2041. modal.show();
  2042. };
  2043. // Fonction pour soumettre le signalement
  2044. window.submitReport = function () {
  2045. const reason = document.getElementById('reportReason').value;
  2046. const description = document.getElementById('reportDescription').value;
  2047. const email = document.getElementById('reportEmail').value;
  2048. if (! reason || ! description) {
  2049. showNotification('Veuillez remplir tous les champs obligatoires', 'error');
  2050. return;
  2051. }
  2052. // Simuler l'envoi du signalement
  2053. const reportData = {
  2054. shopId: {{ shop.id }},
  2055. reason: reason,
  2056. description: description,
  2057. email: email,
  2058. reportedAt: new Date().toISOString()
  2059. };
  2060. console.log('Signalement envoyé:', reportData);
  2061. // Fermer le modal
  2062. const modal = bootstrap.Modal.getInstance(document.getElementById('reportModal'));
  2063. modal.hide();
  2064. // Réinitialiser le formulaire
  2065. document.getElementById('reportForm').reset();
  2066. // Afficher la confirmation
  2067. showNotification('Signalement envoyé avec succès. Nous examinerons votre demande.', 'success');
  2068. };
  2069. // Gestion du carrousel eBay-style
  2070. let currentSlide = 0;
  2071. let carouselInterval;
  2072. let isPaused = false;
  2073. let slides = [];
  2074. let indicators = [];
  2075. function initCarousel() {
  2076.     // Réinitialiser les variables
  2077.     currentSlide = 0;
  2078.     isPaused = false;
  2079.     
  2080.     // Récupérer les slides et indicateurs à nouveau
  2081.     const carouselContainer = document.querySelector('.shop-carousel-ebay');
  2082.     if (!carouselContainer) {
  2083.         console.log('Carousel container not found');
  2084.         return;
  2085.     }
  2086.     
  2087.     const allSlides = carouselContainer.querySelectorAll('.carousel-slide');
  2088.     const allIndicators = carouselContainer.querySelectorAll('.carousel-indicator-ebay');
  2089.     
  2090.     if (allSlides.length === 0) {
  2091.         // Masquer les contrôles si aucune image
  2092.         const controls = carouselContainer.querySelector('.carousel-controls-ebay');
  2093.         const indicators = carouselContainer.querySelector('.carousel-indicators-ebay');
  2094.         if (controls) controls.style.display = 'none';
  2095.         if (indicators) indicators.style.display = 'none';
  2096.         return;
  2097.     }
  2098.     
  2099.     // Si une seule image, masquer les contrôles
  2100.     if (allSlides.length <= 1) {
  2101.         const controls = carouselContainer.querySelector('.carousel-controls-ebay');
  2102.         const indicators = carouselContainer.querySelector('.carousel-indicators-ebay');
  2103.         if (controls) controls.style.display = 'none';
  2104.         if (indicators) indicators.style.display = 'none';
  2105.         // S'assurer que la slide unique est active
  2106.         allSlides[0].classList.add('active');
  2107.         return;
  2108.     }
  2109.     
  2110.     // Afficher les contrôles si plusieurs images
  2111.     const controls = carouselContainer.querySelector('.carousel-controls-ebay');
  2112.     const indicators = carouselContainer.querySelector('.carousel-indicators-ebay');
  2113.     if (controls) controls.style.display = 'flex';
  2114.     if (indicators) indicators.style.display = 'flex';
  2115.     
  2116.     // Mettre à jour les références globales
  2117.     slides = allSlides;
  2118.     indicators = allIndicators;
  2119.     
  2120.     // S'assurer que la première slide est active
  2121.     updateCarousel();
  2122.     
  2123.     // Démarrer le carrousel automatique
  2124.     startCarousel();
  2125.     
  2126.     // Gérer les événements de survol
  2127.     carouselContainer.addEventListener('mouseenter', pauseCarousel);
  2128.     carouselContainer.addEventListener('mouseleave', () => {
  2129.             if (!isPaused) startCarousel();
  2130.         });
  2131. }
  2132. function startCarousel() {
  2133.     // Nettoyer l'intervalle existant
  2134.     clearInterval(carouselInterval);
  2135.     
  2136.     if (slides.length <= 1) return;
  2137.     
  2138.     carouselInterval = setInterval(() => {
  2139.         if (!isPaused && slides.length > 0) {
  2140.             nextSlide();
  2141.         }
  2142.     }, 4000); // Change toutes les 4 secondes
  2143. }
  2144. function pauseCarousel() {
  2145. isPaused = true;
  2146. clearInterval(carouselInterval);
  2147. const pauseIcon = document.getElementById('pauseIcon');
  2148. if (pauseIcon) {
  2149.     pauseIcon.className = 'lnr lnr-play';
  2150. }
  2151. }
  2152. function resumeCarousel() {
  2153. isPaused = false;
  2154. const pauseIcon = document.getElementById('pauseIcon');
  2155. if (pauseIcon) {
  2156.     pauseIcon.className = 'lnr lnr-pause';
  2157. }
  2158. startCarousel();
  2159. }
  2160. function toggleCarousel() {
  2161. if (isPaused) {
  2162. resumeCarousel();
  2163. } else {
  2164. pauseCarousel();
  2165. }
  2166. }
  2167. function nextSlide() {
  2168. if (slides.length === 0) return;
  2169. currentSlide = (currentSlide + 1) % slides.length;
  2170. updateCarousel();
  2171. }
  2172. function previousSlide() {
  2173. if (slides.length === 0) return;
  2174. currentSlide = (currentSlide - 1 + slides.length) % slides.length;
  2175. updateCarousel();
  2176. }
  2177. function goToSlide(index) {
  2178. if (slides.length === 0) return;
  2179. if (index < 0 || index >= slides.length) return;
  2180. currentSlide = index;
  2181. updateCarousel();
  2182. }
  2183. function updateCarousel() {
  2184.     if (slides.length === 0 || indicators.length === 0) return;
  2185.     
  2186.     // Masquer toutes les slides
  2187.     slides.forEach(slide => slide.classList.remove('active'));
  2188.     indicators.forEach(indicator => indicator.classList.remove('active'));
  2189.     
  2190.     // Afficher la slide active
  2191.     if (slides[currentSlide]) {
  2192.         slides[currentSlide].classList.add('active');
  2193.     }
  2194.     if (indicators[currentSlide]) {
  2195.         indicators[currentSlide].classList.add('active');
  2196.     }
  2197. }
  2198. // Fonctions globales pour les boutons
  2199. window.nextSlide = nextSlide;
  2200. window.previousSlide = previousSlide;
  2201. window.goToSlide = goToSlide;
  2202. window.toggleCarousel = toggleCarousel;
  2203. // Gestion du tri des produits via API Symfony
  2204. console.log('=== INITIALIZING PRODUCT SORTING ===');
  2205. console.log('Shop ID:', {{ shop.id }});
  2206. // Fonction de tri via AJAX - RENDUE GLOBALE
  2207. window.sortProducts = function (sortValue) {
  2208. console.log('=== SORT PRODUCTS CALLED ===');
  2209. console.log('Sort value:', sortValue);
  2210. const productsContainer = document.getElementById('products-container');
  2211. console.log('Products container:', productsContainer);
  2212. if (! productsContainer) {
  2213. console.error('Products container not found!');
  2214. return;
  2215. }
  2216. if (! sortValue) {
  2217. console.log('Resetting to original order');
  2218. // Recharger la page pour revenir à l'ordre original
  2219. window.location.reload();
  2220. return;
  2221. }
  2222. console.log('Showing loading spinner...');
  2223. // Afficher un indicateur de chargement
  2224. productsContainer.innerHTML = '<div class="col-12 text-center py-5"><div class="spinner-border text-primary" role="status"><span class="visually-hidden">Chargement...</span></div><p class="mt-3">Tri des produits en cours...</p></div>';
  2225. // Récupérer l'ID de la boutique
  2226. const shopId = {{ shop.id }};
  2227. console.log('Shop ID for request:', shopId);
  2228. const url = "{{ path('ui_api_shop_products_sort', {id: '__SHOP_ID__'}) }}".replace('__SHOP_ID__', shopId);
  2229. console.log('Request URL:', url);
  2230. const requestData = {
  2231. sortBy: sortValue
  2232. };
  2233. console.log('Request data:', requestData);
  2234. // Envoyer la requête AJAX
  2235. console.log('Sending AJAX request...');
  2236. fetch(url, {
  2237. method: 'POST',
  2238. headers: {
  2239. 'Content-Type': 'application/json',
  2240. 'X-Requested-With': 'XMLHttpRequest'
  2241. },
  2242. body: JSON.stringify(requestData)
  2243. }).then(response => {
  2244. console.log('Response received:', response);
  2245. console.log('Response status:', response.status);
  2246. return response.json();
  2247. }).then(data => {
  2248. console.log('Sort response data:', data);
  2249. if (data.success) {
  2250. console.log('Sort successful, updating content...');
  2251. // Mettre à jour le contenu avec le HTML retourné
  2252. productsContainer.innerHTML = data.html;
  2253. // Mettre à jour le compteur de produits
  2254. const productCount = document.querySelector('.product-count');
  2255. if (productCount) {
  2256. productCount.textContent = data.count;
  2257. }
  2258. console.log('Products sorted successfully!');
  2259. } else {
  2260. console.error('Sort failed:', data.message);
  2261. showNotification('Erreur lors du tri: ' + data.message, 'error');
  2262. // Recharger la page en cas d'erreur
  2263. window.location.reload();
  2264. }
  2265. }).catch(error => {
  2266. console.error('Sort request failed:', error);
  2267. showNotification('Erreur de connexion lors du tri', 'error');
  2268. // Recharger la page en cas d'erreur
  2269. window.location.reload();
  2270. });
  2271. };
  2272. // Attendre que le DOM soit chargé
  2273. console.log('Setting up event listeners...');
  2274. setTimeout(() => {
  2275. const sortSelect = document.getElementById('product-sort');
  2276. console.log('Sort select element:', sortSelect);
  2277. if (sortSelect) {
  2278. console.log('Adding change event listener...');
  2279. // Ecouter l'événement change avec jQuery (nécessaire à cause de nice-select)
  2280. if (typeof $ !== 'undefined') {
  2281.     $('#product-sort').on('change', function() {
  2282.         console.log('=== SELECT CHANGE EVENT TRIGGERED (jQuery) ===');
  2283.         if(window.sortProducts) window.sortProducts(this.value);
  2284.     });
  2285. }
  2286. sortSelect.addEventListener('change', function () {
  2287. console.log('=== SELECT CHANGE EVENT TRIGGERED ===');
  2288. console.log('Selected value:', this.value);
  2289. console.log('Calling sortProducts...');
  2290. window.sortProducts(this.value);
  2291. });
  2292. console.log('Event listener added successfully');
  2293. } else {
  2294. console.error('Sort select element not found!');
  2295. console.log('Available elements with ID containing "sort":', document.querySelectorAll('[id*="sort"]'));
  2296. console.log('Available elements with class containing "form-select":', document.querySelectorAll('.form-select'));
  2297. }
  2298. }, 100);
  2299. // Gestion du bouton "Suivre"
  2300. const followBtn = document.querySelector('.btn-shop');
  2301. if (followBtn) {
  2302. followBtn.addEventListener('click', function () {
  2303. if (this.innerHTML.includes('Suivre')) {
  2304. this.innerHTML = '<i class="lnr lnr-heart me-1"></i> Suivi';
  2305. this.classList.remove('btn-shop');
  2306. this.classList.add('btn-success');
  2307. } else {
  2308. this.innerHTML = '<i class="lnr lnr-heart me-1"></i> Suivre';
  2309. this.classList.remove('btn-success');
  2310. this.classList.add('btn-shop');
  2311. }
  2312. });
  2313. }
  2314. });
  2315.     </script>
  2316. {% endblock %}