.widget{
  .textwidget iframe {
    max-width: 100%;
  }
  .shortcode-categories-icons {
    table {
      width: 100%;
      text-align: center;
      margin-top: 30px;
      tr {
        td {
          width: 50%;
          padding: 25px 0px 25px 0px;
          border-right: 1px dashed rgba(0,0,0,0.1);
          border-bottom: 1px dashed rgba(0,0,0,0.1);
          &:last-child {
            border-right: none;
          }
        }
        &:last-child {
          td {
            border-bottom: none;
          }
        }
      }
    }
    a {
      color: @headingsColor;
    }
    h3 {
      margin-top: 10px; 
      margin-bottom: 0px;
    }
    img {
      width: 48px;
      height: auto;
    }
  }
  &.with-ribbon .shortcode-categories-icons {
    table {
      margin-top: -30px;
    }
  }
  &.widget_mc4wp_widget, &.widget_mc4wp_form_widget {
    text-align: center;
    margin-bottom: 40px;
    .widget-title {
    }
    label {
      color: rgba(0,0,0,0.6);
      font-size: floor(@baseFontSize * 0.8);
      margin-bottom: 15px;
      display: block;
    }
    #mc4wp_email, input[type="email"], input[type="text"] {
      background-color: #f2f5f5;
      border: 1px solid darken(#f2f5f5, 10%);
      .box-shadow(inset 1px 1px 2px 0px rgba(0,0,0,0.1));
      font-size: floor(@baseFontSize * 0.9);
      padding: 15px 10px;
      border-radius: 4px;
      display: block;
      width: 100%;
      text-align: center;
    }
    input[type="submit"]{
      .btn-large();
      display: none;
    }
    .mc4wp-alert {
      font-size: floor(@baseFontSize * 0.9);
      padding: 10px;
      margin-top: 10px;
      border-radius: 4px;
      &.mc4wp-success {
        background-color: #d8ecc6;
        color: #414a39;
        border: 1px solid #b9c9ab;
      }
    }
    p {
      margin-bottom: 0px;
    }
  }

  &.widget_calendar {

    .details-heading {
      &:before {
        .osfont();
        content: "\f133";
        font-size: 20px;
        margin-right: 15px;
      }
    }

    caption {
      text-transform: uppercase;
      font-size: ceil(@baseFontSize * 0.9);
      margin-bottom: 5px;
    }
    table {
      width: 100%;
      font-size: ceil(@baseFontSize * 0.9);
    }
    th {
      text-align: right;
      padding: 5px;
      border: none;
      text-align: center;
      border: 1px solid rgba(0,0,0,0.05);
    }
    tfoot td{
      padding-top: 10px;
    }
    tbody td {
      text-align: right;
      padding: 5px;
      border: 1px solid rgba(0,0,0,0.05);
      a {
      }
    }
  }
  &.widget_categories, &.widget_pages, &.widget_meta, &.widget_recent_entries, &.widget_nav_menu, &.widget_archive, &.widget_recent_comments {
    ul {
      list-style: none;
      li {
        border-bottom: 1px solid rgba(0,0,0,0.05);
        padding: 8px;
        margin-bottom: 3px;
        font-size: floor(@baseFontSize * 0.9);
        color: lighten(@textColor, 30%);
        a {
          font-size: floor(@baseFontSize);
          color: @textColor;
          border-bottom: 1px solid @textColor;
          padding-bottom: 2px;
          display: inline-block;
        }
        &:last-child {
          border-bottom: none;
          a {
          }
        }
      }
    }
  }
  &.widget_nav_menu {
    li ul {
      padding: 0px;
      padding-left: 20px;
      padding-top: 20px;
      padding-bottom: 10px;
      list-style-type: square;
      li {
        padding: 0px;
      }
    }
  }
  &.widget_recent_comments {
    text-align: left;
    font-size: floor(@baseFontSize * 0.9);
    ul li a, ul li {
      font-size: floor(@baseFontSize * 0.9);
    }
    .comment-author-link {
      display: block;
      margin-bottom: 5px;
      font-size: floor(@headingsBaseFontSize * 1);
      text-transform: uppercase;
      .font-headings();
      a {
        font-size: floor(@headingsBaseFontSize * 1);
      }
    }
  }
  &.widget_categories, &.widget_archive {
    .screen-reader-text {
      display: none;
      font-size: floor(@baseFontSize * 0.8);
      margin-bottom: 5px;
      text-align: center;
    }
    select {
      display: block;
      width: 100%;
      padding: 5px;
    }
  }
  &.widget_rss {
    .screen-reader-text {
      display: none;
    }
    .details-heading {
      .rsswidget img {
        display: none;
      }
      .rsswidget {
        margin-left: -3px;
      }
      &:before {
        .osfont();
        content: "\f143";
        font-size: 20px;
        margin-right: 15px;
      }
    }
    .rssSummary {
      font-size: floor(@baseFontSize * 0.9);
    }
    cite {
      display: block;
      text-align: right;
      font-size: floor(@baseFontSize * 0.8);
      text-transform: uppercase;
      margin-top: 5px;
    }
    .rss-date {
      font-size: floor(@baseFontSize * 0.8);
      text-transform: uppercase;
      display: block;
      border-bottom: 1px dotted rgba(0,0,0,0.1);
      border-top: 1px dotted rgba(0,0,0,0.1);
      padding: 5px 0px;
      margin: 5px 0px;
    }
    li {
      list-style: none;
      margin-bottom: 20px;
    }
  }

  &.widget_text {
    img {
      max-width: 100%;
      height: auto;
      margin-bottom: 10px;
      margin-top: 10px;
    }
    .details-heading {
      &:before {
        .osfont();
        content: "\f1ea";
        font-size: 20px;
        margin-right: 15px;
      }
    }
    select {
      max-width: 100%;
    }
  }



  &.widget_search {

    label {
      display: block;
    }
    .search-field {
      border: none;
      padding: 15px;
      font-size: floor(@baseFontSize * 1.2);
      line-height: 1.2;
      height: 50px;
      border-radius: 4px;
      width: 100%;
      display: block;
      .box-shadow(0px 1px 2px 0px rgba(0,0,0,0.15));
    }
    .screen-reader-text {
      display: none;
    }
    .details-heading {
      &:before {
        .osfont();
        content: "\f002";
        font-size: 20px;
        margin-right: 15px;
      }
    }
    .search-submit {
      display: none;
    }
  }
  &.widget_tag_cloud {
    .tagcloud {
      text-align: center;
      a {
        display: inline-block;
        margin-right: 2px;
        margin-bottom: 5px;
        padding: 2px 7px 1px;
        border: 1px solid lighten(@textColor, 20%);
        border-radius: 4px;
        // text-transform: uppercase;
        font-size: floor(@baseFontSize * 0.8)!important;
        color: @textColor;
        &:hover {
          text-decoration: none;
        }
      }
    }
  }

  // POPULAR POSTS WIDGET
  &.widget_widget_tptn_pop, &.tptn_posts_list_widget {
    ul {
      list-style: none;
      margin: 0px;
      padding: 0px;
      li {
        .clearfix();
        border-bottom: 1px solid rgba(0,0,0,0.05);
        padding: 5px 8px;
        margin-bottom: 3px;
        > a {
          display: block;
          float: left;
          width: 30%;
          img {
            max-width: 100%;
            width: 100%;
            height: auto;
            border-radius: @globalBorderRadius;
          }
        }
        .tptn_after_thumb {
          padding-left: 15px;
          display: block;
          width: 70%;
          float: left;
          a {
            font-size: floor(@baseFontSize * 0.9);
            color: @textColor;
            display: block;
          }
        }
      }
    }
  }
  .shortcode-social-links {
    list-style: none;
    margin: 0px;
    padding: 0px;
    text-align: center;
    li {
      line-height: 1;
      display: inline-block;
      margin: 0px 2px 5px 2px;
      a {
        font-size: 42px;
      }
    }
  }
}

.single-panel-details {
  .widget {
    padding-bottom: 40px;
  }
}

// WIDGETS IN A SIDEBAR

.archive-sidebar, .page-sidebar {
  .widget {
    margin-top: 40px;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    padding-bottom: 20px;
    &:first-child {
      margin-top: 0px;
    }
    .widget-title {
      text-transform: uppercase;
      text-align: center;
      margin-bottom: 30px;
      span {
        display: inline-block;
        padding: 5px 0px;
        border-bottom: 2px solid @headingsColor;
      }
      a {
        color: @headingsColor;
      }
    }
    &:last-child {
      border-bottom: none;
    }
    &.widget_categories {
      ul li:last-child{
        border-bottom: none;
      }
    }
    .shortcode-about-author {
      text-align: center;
      .saa-avatar {
        margin-bottom: 20px;
        img {
          max-width: 100%;
          height: auto;
        }
      }
      .saa-content {
        font-style: italic;
      }
    }
  }
  .widget.widget_widget_tptn_pop, .widget.tptn_posts_list_widget {
    .tptn_after_thumb {
      padding-top: 5px;
      .tptn_link {
        .font-headings();
        font-size: @h4FontSize;
      }
      .tptn_excerpt {
        font-size: floor(@baseFontSize * 0.8);
        margin-top: 5px;
        padding-top: 8px;
        border-top: 1px dashed rgba(0,0,0,0.1);
        display: block;
      }
    }
    ul li {
      padding: 0px 0px 10px 0px;
      margin: 0px 0px 10px 0px;
    }
    ul li:last-child {
      border-bottom: none;
      padding-bottom: 0px;
    }
  }
  .widget.widget_mc4wp_widget, .widget.widget_mc4wp_form_widget {
    padding: 20px 30px;
    border-radius: 6px;
    .box-shadow(0px 0px 4px 0px rgba(0,0,0,0.1));
    background-color: #fff;
    border-bottom: none;
    .widget-title {
      margin-top: 0px;
      padding-bottom: 15px;
      margin-bottom: 15px;
      border-bottom: 1px dashed rgba(0,0,0,0.2);
      span {
        padding: 0px;
        border-bottom: none;
      }
    }
  }
  .widget.with-ribbon .widget-title, .header-ribbon {
    background-image: url('@{imagesPath}/ribbon-dark.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: top center;
    text-transform: uppercase;
    text-align: center;
    height: 90px;
    padding-top: 7px;
    span {
      border-bottom: none;
      padding: 0px;
    }
  }
  &.color-scheme-dark {
    color: rgba(255,255,255,0.7);
    .widget {
      border-bottom-color: rgba(255,255,255,0.2);
    }
    .widget-title {
      color: rgba(255,255,255,0.8);
      span {
        border-bottom: 2px solid rgba(255,255,255,0.7);
      }
      a {
        color: rgba(255,255,255,0.7);
      }
    }
    .widget.with-ribbon .widget-title, .header-ribbon {
      color: rgba(255,255,255,0.8);
      background-image: url('@{imagesPath}/ribbon-light.png');
    }


    .widget.widget_widget_tptn_pop, .widget.tptn_posts_list_widget {
      ul {
        li {
          border-bottom: 1px solid rgba(255,255,255,0.1);
          .tptn_after_thumb {
            a {
              color: rgba(255,255,255,0.8);
            }
            .tptn_excerpt {
              border-top-color: rgba(255,255,255,0.3);
            }
          }
        }
      }
    }


    .shortcode-categories-icons {
      table {
        tr {
          td {
            border-right: 1px dashed rgba(255,255,255,0.1);
            border-bottom: 1px dashed rgba(255,255,255,0.1);
            &:last-child {
              border-right: none;
            }
          }
          &:last-child {
            td {
              border-bottom: none;
            }
          }
        }
      }
      a {
        color: rgba(255,255,255,0.8);
      }
    }

    .widget.widget_tag_cloud {
      .tagcloud {
        a {
          border-color: rgba(255,255,255,0.5);
          color: rgba(255,255,255,0.8);
        }
      }
    }

    .widget.widget_mc4wp_widget, .widget.widget_mc4wp_form_widget {
      .box-shadow(0px 0px 4px 0px rgba(0,0,0,0.1));
      background-color: rgba(0,0,0,0.2);
      .widget-title {
        border-bottom: 1px dashed rgba(255,255,255,0.2);
        span {
        }
      }
      label {
        color: rgba(255,255,255,0.7);
      }
      #mc4wp_email, input[type="email"], input[type="text"] {
        background-color: rgba(0,0,0,0.2);
        border: rgba(0,0,0,0.3);
        .box-shadow(1px 1px 2px 0px rgba(0,0,0,0.1));
      }
    }
  }
  &.color-scheme-light {

  }
}


// WIDGETS IN THE FOOTER
.pre-footer {
  .widget {
    background-color: #fff;
    float: left;
    border-radius: @globalBorderRadius;

    .widget-title {
      border-bottom: 1px dashed rgba(0,0,0,0.1);
      padding-bottom: 15px;
      margin-bottom: 15px;
      margin-top: 0px;
      text-align: center;
    }
    .shortcode-categories-icons {
      table {
        margin-top: 0px;
      }
    }
  }

  &.widgets-count-2 {
    .widget {
      width: 47.5%;
      padding: 40px;
      margin-right: 5%;
      &:last-child {
        margin-right: 0px;
      }
    }  
  }
  &.widgets-count-3 {
    .widget {
      width: 30%;
      padding: 30px;
      margin-right: 5%;
      &:last-child {
        margin-right: 0px;
      }
    }  
  }
  &.widgets-count-4 {
    .widget {
      width: 22%;
      padding: 20px;
      margin-right: 4%;
      &:last-child {
        margin-right: 0px;
      }
    }  
  }
  &.widgets-count-4 {
    .widget {
      width: 22%;
      padding: 20px;
      margin-right: 4%;
      margin-bottom: 4%;
      &:last-child, &:nth-child(4n) {
        margin-right: 0px;
      }
      &:nth-child(4n + 5) {
        clear: left;
      }
    }  
  }
}